Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available: 6.10.0
metadata
title: NLP Assignment RAG App
emoji: π§
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.44.0
app_file: main.py
pinned: false
python_version: '3.12'
app_build_command: uv sync
NLP Assignment β Research Paper RAG Assistant
This app retrieves and summarizes academic papers related to your research query using a Retrieval-Augmented Generation (RAG) pipeline built with:
- FAISS vector search (
index.faiss,index.pkl) - SentenceTransformer CrossEncoder reranker
- Google Gemini (via LangChain) as the LLM
- Gradio UI frontend
- uv package manager (modern, fast, Python-native)
π How to Run Locally
You can run this project locally using uv (recommended) or plain Python.
π§© Prerequisites
- Python 3.12 or higher
- uv installed:
pip install uv
- Clone the repository
git clone https://huggingface.co/spaces/njayman/nlp-assignment
cd nlp-assignment
- Add your FAISS index files
Make sure your FAISS index folder is structured like this:
faiss_index/
βββ index.faiss
βββ index.pkl
- Set up environment
Set your Gemini API key (replace with your own key):
Linux/macOS:
export GOOGLE_API_KEY="your_google_api_key_here"
Windows (PowerShell):
$env:GOOGLE_API_KEY="your_google_api_key_here"
Or add a .env file
GOOGLE_API_KEY="your_google_api_key_here"
- Create a virtual env and install dependencies using uv
uv venv
uv sync
- Run the Gradio app
uv run main.py
Then open the link printed in your terminal β usually:
http://127.0.0.1:7860