simple-qa-app / README.md
Arcelily's picture
Upload 5 files
a2d9f84 verified
|
Raw History Blame Contribute Delete
1.34 kB
metadata
title: SimpleQnA
emoji: πŸ”Ž
colorFrom: red
colorTo: red
sdk: docker
app_port: 8501
tags:
  - streamlit
pinned: false
short_description: Streamlit template space for a simple QA app

Simple QA with LangChain (Open-Source LLM)

This Space demonstrates a minimal Retrieval-Augmented Generation (RAG) app:

  • Upload PDFs or paste text πŸ“š
  • Build a FAISS index with MiniLM embeddings 🧠
  • Ask grounded questions with an open-source LLM (default: Qwen/Qwen2.5-1.5B-Instruct) πŸ’¬

How to use

  1. Upload a PDF or paste text in Knowledge Base.
  2. Click Build Knowledge Base.
  3. Type a question and click Get Answer.
  4. (Optional) Toggle Show retrieved chunks to inspect sources.

Swap the model

Change the model in the sidebar (e.g., TinyLlama/TinyLlama-1.1B-Chat-v1.0).

Run locally

  1. Create & activate a venv:

    python -m venv .venv
    source .venv/bin/activate  # Windows: .venv\\Scripts\\activate
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Run:

    streamlit run streamlit_app.py
    

Deploy to Hugging Face Spaces

  1. Create a new Space (Type: Streamlit).
  2. Upload these files: streamlit_app.py, requirements.txt, README.md, runtime.txt, Dockerfile.
  3. Wait for the build to finish β€” the app will auto-start.