Demo
VARAG Plaground¶
Explore VARAG with our interactive playground! It lets you seamlessly compare various RAG (Retrieval-Augmented Generation) solutions, from data ingestion to retrieval.
This makes it easy to test and experiment with different approaches in real-time.
Recommended: Run this Notebook with a T4 GPU
In [ ]:
Copied!
!git clone https://github.com/adithya-s-k/VARAG
%cd VARAG
%pwd
!git clone https://github.com/adithya-s-k/VARAG
%cd VARAG
%pwd
In [ ]:
Copied!
!apt-get update && apt-get install -y && apt-get install -y poppler-utils
!apt-get update && apt-get install -y && apt-get install -y poppler-utils
In [ ]:
Copied!
%pip install -e .
## We will be using Docling for OCR
%pip install docling
%pip install -e .
## We will be using Docling for OCR
%pip install docling
In [ ]:
Copied!
!pip install --upgrade gradio
!pip install --upgrade gradio
Add your OpenAI API Key
To add your OpenAI API key and Gemini API Key to Colab secrets:
- Click on the "🔑 Secrets" tab in the left sidebar of your Colab notebook.
- Click the "+" button to add a new secret.
- In the "Name" field, enter
OPENAI_API_KEY
. - In the "Value" field, paste your OpenAI API key.
- Make sure the "Notebook access" toggle is enabled for this secret.
- Repeat the same process for
GEMINI_API_KEY
. - Click "Done".
Now your keys are securely stored and can be accessed in your notebook using userdata.get('OPENAI_API_KEY')
.
In [ ]:
Copied!
import os
from google.colab import userdata
# Store your OpenAI API key in Colab secrets under the name 'OPENAI_API_KEY'
#os.environ['OPENAI_API_KEY'] = userdata.get('OPENAI_API_KEY') #USES OPENAI
os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY') #USES LITELLM
import os
from google.colab import userdata
# Store your OpenAI API key in Colab secrets under the name 'OPENAI_API_KEY'
#os.environ['OPENAI_API_KEY'] = userdata.get('OPENAI_API_KEY') #USES OPENAI
os.environ['GEMINI_API_KEY'] = userdata.get('GEMINI_API_KEY') #USES LITELLM
Run Gradio¶
In [ ]:
Copied!
#This is the code to run the VARAG Demo without any Interpretability maps
!python demo.py --share
#This is the code to run the VARAG Demo without any Interpretability maps
!python demo.py --share
For exploring colpali interpretation check out codes in examples/inference_colpali
In [ ]:
Copied!
#Run this to load the Interpretability maps feature for colpali
!python examples/inference_colpali/demo_with_heatmaps.py --share
#Run this to load the Interpretability maps feature for colpali
!python examples/inference_colpali/demo_with_heatmaps.py --share