sanabanu31 commited on
Commit
f608a7c
·
verified ·
1 Parent(s): 327dd6c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -10
Dockerfile CHANGED
@@ -1,21 +1,24 @@
1
  FROM python:3.11-slim
2
 
3
- # Install system deps for torch/transformers (optional but recommended)
4
- RUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf /var/lib/apt/lists/*
5
-
6
- # Copy requirements and install dependencies
7
  COPY requirements.txt .
8
  RUN pip install --no-cache-dir -r requirements.txt
9
 
10
- # Set HF cache to avoid permission issues
 
 
 
 
 
 
11
  ENV TRANSFORMERS_CACHE=/tmp/huggingface
12
 
13
- # Copy app code
14
  COPY . /app
15
  WORKDIR /app
16
 
17
- # Expose port (change to 8000 if you want standard)
18
- EXPOSE 8000
19
 
20
- # Run the FastAPI app on port 8000
21
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
  FROM python:3.11-slim
2
 
3
+ # Install dependencies
 
 
 
4
  COPY requirements.txt .
5
  RUN pip install --no-cache-dir -r requirements.txt
6
 
7
+ # Install sentencepiece explicitly to fix tokenizer error
8
+ RUN pip install --no-cache-dir sentencepiece
9
+
10
+ # Ensure consistent sklearn version
11
+ RUN pip install --no-cache-dir scikit-learn==1.6.1
12
+
13
+ # Set Hugging Face cache directory to avoid permission issues
14
  ENV TRANSFORMERS_CACHE=/tmp/huggingface
15
 
16
+ # Copy application code
17
  COPY . /app
18
  WORKDIR /app
19
 
20
+ # Expose the port for FastAPI
21
+ EXPOSE 7860
22
 
23
+ # Run the FastAPI app using uvicorn
24
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]