Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +7 -1
Dockerfile
CHANGED
|
@@ -11,8 +11,14 @@ COPY main.py .
|
|
| 11 |
# Install dependencies
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
# Expose port for FastAPI
|
| 15 |
EXPOSE 7860
|
| 16 |
|
| 17 |
# Run FastAPI server
|
| 18 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 11 |
# Install dependencies
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
| 14 |
+
# Set cache directory
|
| 15 |
+
ENV TRANSFORMERS_CACHE="/app/cache"
|
| 16 |
+
|
| 17 |
+
# Pre-download the model (to avoid runtime downloads)
|
| 18 |
+
RUN python -c "from transformers import pipeline; pipeline('sentiment-analysis', model='distilbert-base-uncased-finetuned-sst-2-english')"
|
| 19 |
+
|
| 20 |
# Expose port for FastAPI
|
| 21 |
EXPOSE 7860
|
| 22 |
|
| 23 |
# Run FastAPI server
|
| 24 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|