Skip to content

Latest commit

 

History

History
35 lines (30 loc) · 1.1 KB

File metadata and controls

35 lines (30 loc) · 1.1 KB

HackRx App

A FastAPI-based application for the HackRx challenge, designed to process documents and answer questions using embeddings and QA models.

Overview

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.

Setup

  1. Install Dependencies:
    .\hackrx_env\Scripts\Activate.ps1
    pip install -r requirements.txt
  2. 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')"
  3. Run Locally:
    uvicorn main:app --host 0.0.0.0 --port 10000

Deploy with ngrok

  1. Download ngrok from ngrok.com.
  2. Start ngrok:
    .\ngrok http 10000

Notes

  • Tested locally with ~2-4s response times (4.23s, 2.34s, 708ms).