Spaces:
Runtime error
Runtime error
Amish Kushwaha commited on
Commit ·
4848e5d
1
Parent(s): adc5557
Fix transformer cache issue - attempt 3
Browse files- Dockerfile +6 -0
Dockerfile
CHANGED
|
@@ -1,6 +1,9 @@
|
|
| 1 |
# Use Python as the base image
|
| 2 |
FROM python:3.9
|
| 3 |
|
|
|
|
|
|
|
|
|
|
| 4 |
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
|
@@ -11,5 +14,8 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 11 |
# Copy the FastAPI app
|
| 12 |
COPY . .
|
| 13 |
|
|
|
|
|
|
|
|
|
|
| 14 |
# Run FastAPI server
|
| 15 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
# Use Python as the base image
|
| 2 |
FROM python:3.9
|
| 3 |
|
| 4 |
+
# Set environment variable for cache
|
| 5 |
+
ENV TRANSFORMERS_CACHE=/app/cache
|
| 6 |
+
|
| 7 |
# Set the working directory
|
| 8 |
WORKDIR /app
|
| 9 |
|
|
|
|
| 14 |
# Copy the FastAPI app
|
| 15 |
COPY . .
|
| 16 |
|
| 17 |
+
# Ensure the cache directory is writable
|
| 18 |
+
RUN mkdir -p /app/cache
|
| 19 |
+
|
| 20 |
# Run FastAPI server
|
| 21 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|