Madras1 commited on
Commit
d70e556
·
verified ·
1 Parent(s): 7fbd9ac

Upload 37 files

Browse files
Files changed (2) hide show
  1. Dockerfile +5 -2
  2. app/config.py +3 -3
Dockerfile CHANGED
@@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
10
  # Copy all files first
11
  COPY . .
12
 
13
- # Install dependencies directly (not editable mode)
14
  RUN pip install --no-cache-dir \
15
  fastapi>=0.115.0 \
16
  uvicorn[standard]>=0.32.0 \
@@ -19,7 +19,10 @@ RUN pip install --no-cache-dir \
19
  httpx>=0.28.0 \
20
  aiohttp>=3.11.0 \
21
  python-dotenv>=1.0.0 \
22
- tenacity>=9.0.0
 
 
 
23
 
24
  # HuggingFace Spaces uses port 7860
25
  EXPOSE 7860
 
10
  # Copy all files first
11
  COPY . .
12
 
13
+ # Install dependencies (lightweight reranking with CPU torch)
14
  RUN pip install --no-cache-dir \
15
  fastapi>=0.115.0 \
16
  uvicorn[standard]>=0.32.0 \
 
19
  httpx>=0.28.0 \
20
  aiohttp>=3.11.0 \
21
  python-dotenv>=1.0.0 \
22
+ tenacity>=9.0.0 \
23
+ numpy \
24
+ sentence-transformers \
25
+ && pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
26
 
27
  # HuggingFace Spaces uses port 7860
28
  EXPOSE 7860
app/config.py CHANGED
@@ -27,9 +27,9 @@ class Settings(BaseSettings):
27
  llm_provider: Literal["groq", "openrouter"] = "openrouter"
28
  llm_model: str = "nex-agi/deepseek-v3.1-nex-n1:free"
29
 
30
- # Reranking Models
31
- bi_encoder_model: str = "BAAI/bge-small-en-v1.5"
32
- cross_encoder_model: str = "BAAI/bge-reranker-base"
33
 
34
  # Temporal Settings
35
  default_freshness_half_life: int = 30 # days
 
27
  llm_provider: Literal["groq", "openrouter"] = "openrouter"
28
  llm_model: str = "nex-agi/deepseek-v3.1-nex-n1:free"
29
 
30
+ # Reranking Models (lightweight for HF Spaces)
31
+ bi_encoder_model: str = "sentence-transformers/all-MiniLM-L6-v2" # ~90MB
32
+ cross_encoder_model: str = "cross-encoder/ms-marco-MiniLM-L6-v2" # ~90MB
33
 
34
  # Temporal Settings
35
  default_freshness_half_life: int = 30 # days