Spaces:
Sleeping
title: USTP Student Handbook Assistant
emoji: π
colorFrom: purple
colorTo: indigo
sdk: streamlit
sdk_version: 1.39.0
app_file: src/streamlit_app.py
pinned: false
license: mit
π USTP Student Handbook Assistant (2023 Edition)
This Streamlit app lets students, faculty, and staff ask questions about the USTP Student Handbook (2023 Edition) and get accurate, page-referenced answers directly from the document β powered by FAISS, Sentence Transformers, and open-source LLMs such as Mistral, Mixtral, and Qwen.
π Features
β
Reads and indexes the USTP Student Handbook 2023 Edition PDF
β
Fast semantic search with FAISS vector database
β
Accurate citation with printed page numbers, not raw PDF indices
β
Choose between multiple open-source models (Mistral, Mixtral, Qwen, etc.)
β
Offline-safe β works even without API tokens
β
Automatic local embedding with MiniLM for fast responses
β
Caches index for instant re-use
π§ LLM Integration (Optional)
You can enhance the assistantβs responses with Hugging Face Inference API or run it completely offline using local models.
π To configure:
- Create a
.envfile in the app root directory. - Add your Hugging Face token (optional): HF_TOKEN = your_huggingface_token
- Save the file and restart the app.
π‘ If you donβt provide a token, the app will automatically use a local SentenceTransformer model for embeddings.
π οΈ Deployment Notes
- Runtime: Python SDK
- SDK: Streamlit
- App file:
src/streamlit_app.py - PDF file: Must be named
USTP Student Handbook 2023 Edition.pdfand placed in the same directory. - Recommended visibility: Public (for demo and student access)
- Supported models:
mistralai/Mistral-7B-Instruct-v0.3mistralai/Mixtral-8x7B-Instruct-v0.1Qwen/Qwen2.5-14B-Instruct
βοΈ Troubleshooting
β οΈ βPermission denied: '/.streamlit'β
If deploying in a restricted environment:
- Set the working directory to a writable path (e.g.,
/home/appuser/app). - Or run:
mkdir -p ~/.streamlit