Skip to content

Commit 3846436

Browse files
committed
Update for Hugging Face Spaces deployment
1 parent 8e9b989 commit 3846436

3 files changed

Lines changed: 39 additions & 3 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ RUN pip install --no-cache-dir uv && \
1010

1111
COPY . .
1212

13-
EXPOSE 8000
13+
EXPOSE 7860
1414

1515
ENV PYTHONUNBUFFERED=1
1616

17-
CMD ["python", "app.py"]
17+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]

README_HF.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: RAG Project - Learn with Transformers
3+
emoji: 🤖
4+
colorFrom: purple
5+
colorTo: blue
6+
sdk: docker
7+
pinned: false
8+
---
9+
10+
# RAG Project - Learn with Transformers
11+
12+
A Retrieval-Augmented Generation (RAG) system built with LangChain, LangGraph, and FastAPI.
13+
14+
## Features
15+
- 🔍 Document retrieval with FAISS vector store
16+
- 🎯 FlashRank reranking for improved relevance
17+
- 🤖 Corrective RAG with LangGraph agent workflow
18+
- 🧠 Powered by Groq LLM
19+
- 📄 Built on "Attention Is All You Need" paper
20+
21+
## Tech Stack
22+
- **LLM**: Groq (openai/gpt-oss-120b)
23+
- **Embeddings**: FastEmbed (BAAI/bge-small-en-v1.5)
24+
- **Vector Store**: FAISS
25+
- **Reranker**: FlashRank (rank-T5-flan)
26+
- **Framework**: LangChain + LangGraph
27+
- **Web**: FastAPI + Jinja2
28+
29+
## Environment Variables Required
30+
Set these in your Space settings:
31+
- `GROQ_API_KEY`
32+
- `GOOGLE_API_KEY`
33+
- `LANGSMITH_API_KEY` (optional)
34+
- `TAVILY_API_KEY` (optional)

app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,6 @@ async def search(request: Request, query: str = Form(...)):
5353

5454

5555
if __name__ == "__main__":
56-
uvicorn.run(app, host="0.0.0.0", port=8000)
56+
import os
57+
port = int(os.getenv("PORT", 7860))
58+
uvicorn.run(app, host="0.0.0.0", port=port)

0 commit comments

Comments
 (0)