dharandhamo commited on
Commit
e409f74
Β·
1 Parent(s): a3264f4

chore: add huggingface spaces configuration metadata

Browse files
Files changed (3) hide show
  1. Dockerfile +11 -10
  2. README.md +9 -0
  3. start.sh +13 -0
Dockerfile CHANGED
@@ -26,18 +26,19 @@ COPY requirements.txt .
26
  RUN pip install --no-cache-dir -r requirements.txt && \
27
  pip uninstall -y torch torchvision torchaudio transformers sentence-transformers 2>/dev/null || true
28
 
 
 
 
 
 
29
  # Copy application code
30
  COPY . .
31
 
32
- # Create upload directory
33
- RUN mkdir -p /app/data/uploads /app/evaluation/reports
34
-
35
- # Expose port
36
- EXPOSE 8000
37
 
38
- # Health check
39
- HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
40
- CMD curl -f http://localhost:8000/api/v1/health || exit 1
41
 
42
- # Run the application
43
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
 
26
  RUN pip install --no-cache-dir -r requirements.txt && \
27
  pip uninstall -y torch torchvision torchaudio transformers sentence-transformers 2>/dev/null || true
28
 
29
+ # Create upload, evaluation, and log directories with full read/write permissions
30
+ # (Crucial for Hugging Face Spaces which runs under user ID 1000)
31
+ RUN mkdir -p /app/data/uploads /app/evaluation/reports /app/logs && \
32
+ chmod -R 777 /app/data /app/evaluation /app/logs
33
+
34
  # Copy application code
35
  COPY . .
36
 
37
+ # Make the start script executable
38
+ RUN chmod +x /app/start.sh
 
 
 
39
 
40
+ # Expose the default web port (7860 for Hugging Face, 10000 for Render)
41
+ EXPOSE 7860
 
42
 
43
+ # Run the backend & frontend supervisor script
44
+ CMD ["./start.sh"]
README.md CHANGED
@@ -1,3 +1,12 @@
 
 
 
 
 
 
 
 
 
1
  # πŸ“š Multi-Document RAG System
2
 
3
  A production-ready **Retrieval-Augmented Generation** system for academic research papers with cross-document reasoning and RAGAS evaluation.
 
1
+ ---
2
+ title: Multi Document RAG
3
+ emoji: πŸ“š
4
+ colorFrom: blue
5
+ colorTo: indigo
6
+ sdk: docker
7
+ pinned: false
8
+ ---
9
+
10
  # πŸ“š Multi-Document RAG System
11
 
12
  A production-ready **Retrieval-Augmented Generation** system for academic research papers with cross-document reasoning and RAGAS evaluation.
start.sh ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Start FastAPI backend in the background on port 8000
4
+ echo "πŸš€ Starting FastAPI Backend on port 8000..."
5
+ uvicorn app.main:app --host 0.0.0.0 --port 8000 &
6
+
7
+ # Wait 3 seconds for backend to start up
8
+ sleep 3
9
+
10
+ # Start Chainlit frontend on the port specified by the host (Hugging Face uses 7860)
11
+ PORT=${PORT:-7860}
12
+ echo "🎨 Starting Chainlit Frontend on port $PORT..."
13
+ exec chainlit run chainlit_app/app.py --host 0.0.0.0 --port $PORT