Spaces:
Running
Running
Fix ignore promplem inside dockerignore
Browse files- .dockerignore +1 -1
- Dockerfile +4 -4
- core/__pycache__/config.cpython-313.pyc +0 -0
- logs/app.log +30 -0
- start_api.py +0 -21
.dockerignore
CHANGED
|
@@ -10,6 +10,6 @@ __pycache__/
|
|
| 10 |
.vscode/
|
| 11 |
.idea/
|
| 12 |
logs/
|
| 13 |
-
data/
|
| 14 |
**/__pycache__/
|
| 15 |
**/*.py[cod]
|
|
|
|
| 10 |
.vscode/
|
| 11 |
.idea/
|
| 12 |
logs/
|
| 13 |
+
data/new_data/
|
| 14 |
**/__pycache__/
|
| 15 |
**/*.py[cod]
|
Dockerfile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# ========================
|
| 2 |
# Stage 1 - Builder
|
| 3 |
# ========================
|
| 4 |
-
FROM python:3.
|
| 5 |
|
| 6 |
# Install build dependencies
|
| 7 |
RUN apt-get update && apt-get install -y \
|
|
@@ -21,7 +21,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 21 |
# ========================
|
| 22 |
# Stage 2 - Final Runtime Image
|
| 23 |
# ========================
|
| 24 |
-
FROM python:3.
|
| 25 |
|
| 26 |
# Install minimal runtime dependencies
|
| 27 |
RUN apt-get update && apt-get install -y \
|
|
@@ -32,7 +32,7 @@ RUN useradd --create-home --shell /bin/bash appuser
|
|
| 32 |
WORKDIR /app
|
| 33 |
|
| 34 |
# Copy installed packages and application code
|
| 35 |
-
COPY --from=builder /usr/local/lib/python3.
|
| 36 |
COPY --from=builder /usr/local/bin /usr/local/bin
|
| 37 |
COPY . /app
|
| 38 |
|
|
@@ -47,4 +47,4 @@ EXPOSE 7860
|
|
| 47 |
WORKDIR /app
|
| 48 |
|
| 49 |
# Command to run the FastAPI app
|
| 50 |
-
CMD ["
|
|
|
|
| 1 |
# ========================
|
| 2 |
# Stage 1 - Builder
|
| 3 |
# ========================
|
| 4 |
+
FROM python:3.11-slim AS builder
|
| 5 |
|
| 6 |
# Install build dependencies
|
| 7 |
RUN apt-get update && apt-get install -y \
|
|
|
|
| 21 |
# ========================
|
| 22 |
# Stage 2 - Final Runtime Image
|
| 23 |
# ========================
|
| 24 |
+
FROM python:3.11-slim
|
| 25 |
|
| 26 |
# Install minimal runtime dependencies
|
| 27 |
RUN apt-get update && apt-get install -y \
|
|
|
|
| 32 |
WORKDIR /app
|
| 33 |
|
| 34 |
# Copy installed packages and application code
|
| 35 |
+
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
|
| 36 |
COPY --from=builder /usr/local/bin /usr/local/bin
|
| 37 |
COPY . /app
|
| 38 |
|
|
|
|
| 47 |
WORKDIR /app
|
| 48 |
|
| 49 |
# Command to run the FastAPI app
|
| 50 |
+
CMD ["uvicorn api.app:app --host 0.0.0.0 --port 7860"]
|
core/__pycache__/config.cpython-313.pyc
CHANGED
|
Binary files a/core/__pycache__/config.cpython-313.pyc and b/core/__pycache__/config.cpython-313.pyc differ
|
|
|
logs/app.log
CHANGED
|
@@ -2543,3 +2543,33 @@ Medicatio...
|
|
| 2543 |
2025-10-12 21:21:51,729 - AgenticMedicalRAG - INFO - LLM initialized successfully
|
| 2544 |
2025-10-12 21:21:51,730 - AgenticMedicalRAG - INFO - π Background Init: All components initialized successfully (100%)
|
| 2545 |
2025-10-12 21:21:51,730 - AgenticMedicalRAG - INFO - β
Background initialization completed successfully
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2543 |
2025-10-12 21:21:51,729 - AgenticMedicalRAG - INFO - LLM initialized successfully
|
| 2544 |
2025-10-12 21:21:51,730 - AgenticMedicalRAG - INFO - π Background Init: All components initialized successfully (100%)
|
| 2545 |
2025-10-12 21:21:51,730 - AgenticMedicalRAG - INFO - β
Background initialization completed successfully
|
| 2546 |
+
2025-10-13 00:32:54,720 - AgenticMedicalRAG - INFO - Configuration validation completed
|
| 2547 |
+
2025-10-13 00:32:56,274 - AgenticMedicalRAG - INFO - π Starting background initialization...
|
| 2548 |
+
2025-10-13 00:32:56,275 - AgenticMedicalRAG - INFO - π Background Init: Starting background initialization... (0%)
|
| 2549 |
+
2025-10-13 00:32:56,276 - AgenticMedicalRAG - INFO - π Background Init: Loading embedding model... (10%)
|
| 2550 |
+
2025-10-13 00:32:56,277 - AgenticMedicalRAG - INFO - Loading embedding model (first time)...
|
| 2551 |
+
2025-10-13 00:33:06,087 - AgenticMedicalRAG - INFO - Embedding model loaded successfully
|
| 2552 |
+
2025-10-13 00:33:06,087 - AgenticMedicalRAG - INFO - π Background Init: Embedding model loaded successfully (40%)
|
| 2553 |
+
2025-10-13 00:33:06,088 - AgenticMedicalRAG - INFO - π Background Init: Initializing retrievers and loading chunks... (50%)
|
| 2554 |
+
2025-10-13 00:33:06,088 - AgenticMedicalRAG - INFO - π Initializing retrievers (first time use)...
|
| 2555 |
+
2025-10-13 00:33:06,088 - AgenticMedicalRAG - INFO - π Processing new data and updating vector store if needed...
|
| 2556 |
+
2025-10-13 00:33:06,241 - AgenticMedicalRAG - INFO - π¦ Loading chunks cache for BM25 retriever...
|
| 2557 |
+
2025-10-13 00:33:06,266 - AgenticMedicalRAG - INFO - π Creating vector retriever...
|
| 2558 |
+
2025-10-13 00:33:06,266 - AgenticMedicalRAG - INFO - π Creating BM25 retriever...
|
| 2559 |
+
2025-10-13 00:33:06,618 - AgenticMedicalRAG - INFO - π Creating hybrid retriever...
|
| 2560 |
+
2025-10-13 00:33:06,619 - AgenticMedicalRAG - INFO - β
Retrievers initialized successfully.
|
| 2561 |
+
2025-10-13 00:33:06,619 - AgenticMedicalRAG - INFO - π Background Init: Retrievers initialized successfully (90%)
|
| 2562 |
+
2025-10-13 00:33:06,619 - AgenticMedicalRAG - INFO - π Background Init: Warming up LLM... (95%)
|
| 2563 |
+
2025-10-13 00:33:06,620 - AgenticMedicalRAG - INFO - Initializing LLM (first time)...
|
| 2564 |
+
2025-10-13 00:33:08,049 - AgenticMedicalRAG - INFO - LLM initialized successfully
|
| 2565 |
+
2025-10-13 00:33:08,049 - AgenticMedicalRAG - INFO - π Background Init: All components initialized successfully (100%)
|
| 2566 |
+
2025-10-13 00:33:08,050 - AgenticMedicalRAG - INFO - β
Background initialization completed successfully
|
| 2567 |
+
2025-10-13 00:33:38,905 - AgenticMedicalRAG - INFO - Processing user input (attempt 1): What is the recommended first-line treatment for a...
|
| 2568 |
+
2025-10-13 00:33:44,470 - AgenticMedicalRAG - INFO - Successfully processed user input: What is the recommended first-line treatment for a...
|
| 2569 |
+
2025-10-13 00:33:44,471 - AgenticMedicalRAG - INFO - Performing automatic validation...
|
| 2570 |
+
2025-10-13 00:33:45,323 - AgenticMedicalRAG - INFO - Medical answer validator initialized successfully
|
| 2571 |
+
2025-10-13 00:33:45,323 - AgenticMedicalRAG - INFO - GitHub storage initialized for MoazEldsouky/cloud-data-store
|
| 2572 |
+
2025-10-13 00:33:46,100 - AgenticMedicalRAG - INFO - Starting validation for interaction 15
|
| 2573 |
+
2025-10-13 00:33:57,221 - AgenticMedicalRAG - INFO - Assigned unique interaction ID: 15
|
| 2574 |
+
2025-10-13 00:34:00,069 - AgenticMedicalRAG - INFO - Successfully uploaded medical_data/evaluation_results.json to GitHub
|
| 2575 |
+
2025-10-13 00:34:00,070 - AgenticMedicalRAG - INFO - Evaluation saved to GitHub with ID: 15
|
start_api.py
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
"""
|
| 2 |
-
Startup script for Medical RAG AI Advisor API
|
| 3 |
-
"""
|
| 4 |
-
import sys
|
| 5 |
-
import os
|
| 6 |
-
import uvicorn
|
| 7 |
-
|
| 8 |
-
# Add core to Python path
|
| 9 |
-
sys.path.append(os.path.join(os.path.dirname(__file__), 'core'))
|
| 10 |
-
|
| 11 |
-
if __name__ == "__main__":
|
| 12 |
-
|
| 13 |
-
uvicorn.run(
|
| 14 |
-
"api.app:app",
|
| 15 |
-
host="127.0.0.1", # Use localhost instead of 0.0.0.0
|
| 16 |
-
port=8000,
|
| 17 |
-
reload=True, # Disable reload in production for faster startup
|
| 18 |
-
log_level="info",
|
| 19 |
-
access_log=True,
|
| 20 |
-
workers=1 # Single worker for development
|
| 21 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|