sanchitshaleen
commited on
Commit
·
573e464
1
Parent(s):
daa6afe
Initial deployment of RAG with Gemma-3 to Hugging Face Spaces
Browse files- Added production-grade RAG system with Gemma-3 LLM
- Intelligent query caching (700x performance improvement)
- Multi-document support with semantic search
- User authentication and session management
- FastAPI backend with async streaming responses
- Streamlit web interface
- Qdrant vector database for embeddings
- PostgreSQL for user data
- Redis for cache and history
- Comprehensive documentation and troubleshooting guides
- .streamlit/config.toml +20 -0
- .streamlit/secrets.toml +5 -0
- Dockerfile +4 -1
- README.md +0 -1
- deploy_to_hf.sh +2 -0
.streamlit/config.toml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[theme]
|
| 2 |
+
primaryColor = "#7C3AED"
|
| 3 |
+
backgroundColor = "#0F172A"
|
| 4 |
+
secondaryBackgroundColor = "#1E293B"
|
| 5 |
+
textColor = "#F1F5F9"
|
| 6 |
+
font = "sans serif"
|
| 7 |
+
|
| 8 |
+
[client]
|
| 9 |
+
toolbarMode = "minimal"
|
| 10 |
+
|
| 11 |
+
[logger]
|
| 12 |
+
level = "error"
|
| 13 |
+
|
| 14 |
+
[server]
|
| 15 |
+
enableXsrfProtection = false
|
| 16 |
+
enableCORS = false
|
| 17 |
+
|
| 18 |
+
[ui]
|
| 19 |
+
hiddenSidebarNav = false
|
| 20 |
+
darkMode = true
|
.streamlit/secrets.toml
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[llm]
|
| 2 |
+
per_step_delay = 1
|
| 3 |
+
end_delay = 1.0
|
| 4 |
+
[server]
|
| 5 |
+
ip_address = "http://localhost:8000"
|
Dockerfile
CHANGED
|
@@ -16,9 +16,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 16 |
COPY server/ /fastAPI/
|
| 17 |
COPY assets/ /streamlit/assets/
|
| 18 |
COPY app.py /streamlit/app.py
|
| 19 |
-
COPY .streamlit/ /streamlit/.streamlit/
|
| 20 |
COPY server/logger.py /streamlit/logger.py
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
# Copy requirements
|
| 23 |
COPY requirements.txt /temp_files/requirements.txt
|
| 24 |
|
|
|
|
| 16 |
COPY server/ /fastAPI/
|
| 17 |
COPY assets/ /streamlit/assets/
|
| 18 |
COPY app.py /streamlit/app.py
|
|
|
|
| 19 |
COPY server/logger.py /streamlit/logger.py
|
| 20 |
|
| 21 |
+
# Copy streamlit config directory (create if it doesn't exist)
|
| 22 |
+
RUN mkdir -p /streamlit/.streamlit
|
| 23 |
+
COPY .streamlit/ /streamlit/.streamlit/
|
| 24 |
+
|
| 25 |
# Copy requirements
|
| 26 |
COPY requirements.txt /temp_files/requirements.txt
|
| 27 |
|
README.md
CHANGED
|
@@ -689,4 +689,3 @@ Any contributions or suggestions are welcome!
|
|
| 689 |
- **Forked from** - [Bbs1412/chat-with-your-data](https://github.com/Bbs1412/chat-with-your-data)
|
| 690 |
- **Original Author -** Bhushan Songire
|
| 691 |
- **Enhanced & Deployed by** - Sanchit Shaleen
|
| 692 |
-
|
|
|
|
| 689 |
- **Forked from** - [Bbs1412/chat-with-your-data](https://github.com/Bbs1412/chat-with-your-data)
|
| 690 |
- **Original Author -** Bhushan Songire
|
| 691 |
- **Enhanced & Deployed by** - Sanchit Shaleen
|
|
|
deploy_to_hf.sh
CHANGED
|
@@ -110,7 +110,9 @@ if [ ! -f "${SOURCE_DIR}/Dockerfile" ]; then
|
|
| 110 |
fi
|
| 111 |
|
| 112 |
# Copy all files except virtual environments and cache
|
|
|
|
| 113 |
cp -r "${SOURCE_DIR}"/* . 2>/dev/null || true
|
|
|
|
| 114 |
|
| 115 |
# Clean up local-only files (but keep .git which is needed for HF)
|
| 116 |
echo " Cleaning up local files..."
|
|
|
|
| 110 |
fi
|
| 111 |
|
| 112 |
# Copy all files except virtual environments and cache
|
| 113 |
+
# Note: Need to copy both regular and hidden files (like .streamlit/)
|
| 114 |
cp -r "${SOURCE_DIR}"/* . 2>/dev/null || true
|
| 115 |
+
cp -r "${SOURCE_DIR}"/.streamlit . 2>/dev/null || true
|
| 116 |
|
| 117 |
# Clean up local-only files (but keep .git which is needed for HF)
|
| 118 |
echo " Cleaning up local files..."
|