Skip to content

Commit

Permalink
updated example
Browse files Browse the repository at this point in the history
  • Loading branch information
raghavdixit99 committed Mar 2, 2024
1 parent 01d2445 commit 9f472e7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 86 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ If you're looking for in-depth tutorial-like examples, checkout the [tutorials](
| [Facial Recognition](./examples/facial_recognition) | <a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/facial_recognition/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a> |
| [Accelerate Vector Search Applications Using OpenVINO](/tutorials/Accelerate-Vector-Search-Applications-Using-OpenVINO/) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/tutorials/Accelerate-Vector-Search-Applications-Using-OpenVINO/clip_text_image_search.ipynb) [![local LLM](https://img.shields.io/badge/local-llm-green)](#)| [![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://blog.lancedb.com/accelerate-vector-search-applications-using-openvino-51366eabf866)|
| [Search Within Images](/examples/Contextual-Compression-with-RAG/) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/search-within-images-with-sam-and-clip/main.ipynb) [![local LLM](https://img.shields.io/badge/local-llm-green)](#) |[![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://blog.lancedb.com/search-within-an-image-331b54e4285e)|
| [Contextual-Compression-with-RAG](/examples/Contextual-Compression-with-RAG/) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Contextual-Compression-with-RAG/main.ipynb) [![local LLM](https://img.shields.io/badge/local-llm-green)](#) |[![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/etoai/enhance-rag-integrate-contextual-compression-and-filtering-for-precision-a29d4a810301)


| [Contextual-Compression-with-RAG](/examples/Contextual-Compression-with-RAG/) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/Contextual-Compression-with-RAG/main.ipynb) [![local LLM](https://img.shields.io/badge/local-llm-green)](#) |[![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/etoai/enhance-rag-integrate-contextual-compression-and-filtering-for-precision-a29d4a810301) |
| [Imagebind demo app](/examples/imagebind_demo/) | <a href="https://huggingface.co/spaces/raghavd99/imagebind2"><img src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo-with-title.svg" alt="hf spaces" style="width: 5.5rem; vertical-align: middle; background-color: white;"></a>|



Expand Down
4 changes: 3 additions & 1 deletion examples/imagebind_demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
A gradio app showcasing multi-modal capabilities of Imagebind supported via lanceDB API

## Usage
you can run it locally by cloning the project as mentioned below, or access via Colab - <a href="https://colab.research.google.com/github/lancedb/vectordb-recipes/blob/main/examples/imagebind_demo/main.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a>
you can run it locally by cloning the project as mentioned below, or access via Spaces: <a href="https://huggingface.co/spaces/raghavd99/imagebind2">
<img src="https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo-with-title.svg" alt="hf spaces" style="width: 5.75rem; vertical-align: middle; background-color: white;">
</a>

```bash
git clone https://github.com/lancedb/vectordb-recipes.git
Expand Down
7 changes: 3 additions & 4 deletions examples/imagebind_demo/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

model = get_registry().get("imagebind").create()


class TextModel(LanceModel):
text: str
image_uri: str = model.SourceField()
Expand Down Expand Up @@ -63,21 +62,21 @@ def process_audio(inp_audio) -> str:
im_to_at = gr.Interface(
process_image,
gr.Image(type="filepath", value=image_paths[0]),
["text", "audio"],
[gr.Text(label="Output Text"), gr.Audio(label="Output Audio")],
examples=image_paths,
allow_flagging="never",
)
txt_to_ia = gr.Interface(
process_text,
gr.Textbox(label="Enter a prompt:"),
["image", "audio"],
[gr.Image(label="Output Image"), gr.Audio(label="Output Audio")],
allow_flagging="never",
examples=text_list,
)
a_to_it = gr.Interface(
process_audio,
gr.Audio(type="filepath", value=audio_paths[0]),
["image", "text"],
[gr.Image(label="Output Image"), gr.Text(label="Output Text")],
examples=audio_paths,
allow_flagging="never",
)
Expand Down
6 changes: 6 additions & 0 deletions examples/imagebind_demo/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@
"https://github.com/raghavdixit99/assets/raw/main/bird_audio.wav",
"https://github.com/raghavdixit99/assets/raw/main/dragon-growl-37570.wav",
"https://github.com/raghavdixit99/assets/raw/main/car_audio.wav",
"https://github.com/raghavdixit99/assets/raw/main/acoustic-guitar.wav",
"https://github.com/raghavdixit99/assets/raw/main/witch-103635.wav",
"https://github.com/raghavdixit99/assets/raw/main/thunder-25689.wav"
]
image_urls = [
"https://github.com/raghavdixit99/assets/assets/34462078/abf47cc4-d979-4aaa-83be-53a2115bf318",
"https://github.com/raghavdixit99/assets/assets/34462078/93be928e-522b-4e37-889d-d4efd54b2112",
"https://github.com/raghavdixit99/assets/assets/34462078/025deaff-632a-4829-a86c-3de6e326402f",
"https://github.com/raghavdixit99/assets/assets/34462078/a20bff32-155c-4bad-acf1-97856c493099",
"https://github.com/raghavdixit99/assets/assets/34462078/4f7dadd8-b38c-4c14-ac8a-5a2e74414f6a",
"https://github.com/raghavdixit99/assets/assets/34462078/ac11eeab-7b2b-4db3-981b-d5fed08d9bc2"
]

base_path = os.path.dirname(os.path.abspath(__file__))
Expand Down
78 changes: 0 additions & 78 deletions examples/imagebind_demo/main.ipynb

This file was deleted.

0 comments on commit 9f472e7

Please sign in to comment.