Skip to content

Commit

Permalink
Merge pull request #18 from ttrigui/filter_query
Browse files Browse the repository at this point in the history
Fixed long video ingest issue. updated readme with easy commands. dropped ffmpeg
  • Loading branch information
ttrigui authored Aug 4, 2024
2 parents e31e8cf + fd16472 commit a63c890
Show file tree
Hide file tree
Showing 7,399 changed files with 158 additions and 1,284,683 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
48 changes: 9 additions & 39 deletions VideoRAGQnA/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Video RAG is a framework that retrieves video based on provided user prompt. It
- **UI**: streamlit
- **Vector Storage**: Intel's VDMS
- **Video Embeddings**: CLIP w/ mean aggragation
- **RAG Retriever**: Langchain Ensemble Retrieval
- **RAG Retriever**: Langchain MultiModal Retrieval
- **LLM**: Llama-2-7b-chat-hf

## Prerequisites
Expand Down Expand Up @@ -38,62 +38,32 @@ video_ingest/

## Setup and Installation

Install ffmpeg

```bash
apt install ffmpeg
```
Install pip requirements

```bash
cd VideoRAGQnA
conda create --name vrag python=3.9 && conda activate vrag
pip install -r docs/requirements.txt
git clone https://github.com/langchain-ai/langchain
pip install -e langchain/libs/community
```

This code is using a pre-released update of vdms vectordb in LangChain.
Run start.sh script for fresh start. This will download model weights if not exist and restart VDMS container if it's left open.
```bash
cd cw-langchain-vdms-patch/libs/community
pip install -e .
cd ../../../
bash start.sh
```

Download Llama-2-7b-chat-hf and video-llama models

After `start.sh`, if you stopped UI and want to reconnect to UI while keeping previously generated embeddings, execute `runUI.sh` to run UI app and connect to your app.
```bash
mkdir -p embedding/video_llama_weights
cd embedding/video_llama_weights
wget https://huggingface.co/DAMO-NLP-SG/Video-LLaMA-2-7B-Finetuned/resolve/main/VL_LLaMA_2_7B_Finetuned.pth

cd ../../
mkdir -p meta-llama/Llama-2-7b-chat-hf
cd meta-llama/Llama-2-7b-chat-hf
wget https://huggingface.co/DAMO-NLP-SG/Video-LLaMA-2-7B-Finetuned/resolve/main/llama-2-7b-chat-hf/config.json
wget https://huggingface.co/DAMO-NLP-SG/Video-LLaMA-2-7B-Finetuned/resolve/main/llama-2-7b-chat-hf/generation_config.json
wget https://huggingface.co/DAMO-NLP-SG/Video-LLaMA-2-7B-Finetuned/resolve/main/llama-2-7b-chat-hf/pytorch_model-00001-of-00002.bin
wget https://huggingface.co/DAMO-NLP-SG/Video-LLaMA-2-7B-Finetuned/resolve/main/llama-2-7b-chat-hf/pytorch_model-00002-of-00002.bin
wget https://huggingface.co/DAMO-NLP-SG/Video-LLaMA-2-7B-Finetuned/resolve/main/llama-2-7b-chat-hf/pytorch_model.bin.index.json
wget https://huggingface.co/DAMO-NLP-SG/Video-LLaMA-2-7B-Finetuned/resolve/main/llama-2-7b-chat-hf/special_tokens_map.json
wget https://huggingface.co/DAMO-NLP-SG/Video-LLaMA-2-7B-Finetuned/resolve/main/llama-2-7b-chat-hf/tokenizer.json
wget https://huggingface.co/DAMO-NLP-SG/Video-LLaMA-2-7B-Finetuned/resolve/main/llama-2-7b-chat-hf/tokenizer.model
wget https://huggingface.co/DAMO-NLP-SG/Video-LLaMA-2-7B-Finetuned/resolve/main/llama-2-7b-chat-hf/tokenizer_config.json
cd ../..
bash runUI.sh
```

Now you'll find UI up and running once you type `<ip.to.remote.machine>:50055` and hit enter in your brower's address bar.

The current framework supports Intel's VDMS.

Running VDMS DB as docker container
```bash
docker run -d -p 55555:55555 intellabs/vdms:latest
```

**Note-1:** If you are not using file structure similar to what is described above, consider changing it in ```docs/config.yaml```.

**Note-2:** Update your choice of db and port in ```docs/config.yaml```.

**Web UI Video RAG**
```bash
streamlit run video-rag-ui.py docs/config.yaml --server.address 0.0.0.0 --server.port 50055
```


8 changes: 0 additions & 8 deletions VideoRAGQnA/cw-langchain-vdms-patch/CITATION.cff

This file was deleted.

21 changes: 0 additions & 21 deletions VideoRAGQnA/cw-langchain-vdms-patch/LICENSE

This file was deleted.

70 changes: 0 additions & 70 deletions VideoRAGQnA/cw-langchain-vdms-patch/MIGRATE.md

This file was deleted.

75 changes: 0 additions & 75 deletions VideoRAGQnA/cw-langchain-vdms-patch/Makefile

This file was deleted.

137 changes: 0 additions & 137 deletions VideoRAGQnA/cw-langchain-vdms-patch/README.md

This file was deleted.

Loading

0 comments on commit a63c890

Please sign in to comment.