CoolFace
Apppublic

Ayush266/textbook-qa-llama2

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

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

  1. 1.Install dependencies:
bash
pip install -r requirements.txt
  1. 1.Set your Hugging Face token as environment variable:
bash
export HF_TOKEN="your_hf_token_here"
  1. 1.Run:
bash
python app.py
  1. 1.Open the Streamlit interface at http://localhost:8501

How to deploy on Hugging Face Spaces

  1. 1.Upload all files in this repo.
  2. 2.Add your Hugging Face token as secret HF_TOKEN in the Space settings.
  3. 3.The Space will auto-install requirements and start.
  4. 4.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.