Ayush266/textbook-qa-llama2
0
Textbook Q&A with LLaMA 2
This repo contains a combined FastAPI backend and Streamlit frontend for an interactive textbook Q&A system using LLaMA 2.
How to run locally
- Install dependencies:
pip install -r requirements.txt- Set your Hugging Face token as environment variable:
export HF_TOKEN="your_hf_token_here"- Run:
python app.py- Open the Streamlit interface at http://localhost:8501
How to deploy on Hugging Face Spaces
- Upload all files in this repo.
- Add your Hugging Face token as secret
HF_TOKENin the Space settings. - The Space will auto-install requirements and start.
- Use the web UI to upload PDFs/images and ask questions!
Notes
- Backend (FastAPI) runs at port 8000 inside the Space.
- Streamlit frontend communicates with backend locally.
- Uses GPU if available for LLaMA 2 model.
