A FastAPI-based application for the HackRx challenge, designed to process documents and answer questions using embeddings and QA models.
This app uses:
- all-MiniLM-L6-v2 for embeddings.
- distilbert-base-uncased-distilled-squad for question answering.
- Pinecone for vector storage.
- PyPDF2 for document parsing.
- Install Dependencies:
.\hackrx_env\Scripts\Activate.ps1 pip install -r requirements.txt
- Pre-download Models (run once):
python -c "from transformers import AutoTokenizer, AutoModel, pipeline; AutoTokenizer.from_pretrained('distilbert-base-uncased'); AutoModel.from_pretrained('sentence-transformers/all-MiniLM-L6-v2'); pipeline('question-answering', model='distilbert-base-uncased-distilled-squad')" - Run Locally:
uvicorn main:app --host 0.0.0.0 --port 10000
- Download ngrok from ngrok.com.
- Start ngrok:
.\ngrok http 10000
- Tested locally with ~2-4s response times (4.23s, 2.34s, 708ms).