Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -10
Dockerfile
CHANGED
|
@@ -1,21 +1,24 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
-
# Install
|
| 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 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
ENV TRANSFORMERS_CACHE=/tmp/huggingface
|
| 12 |
|
| 13 |
-
# Copy
|
| 14 |
COPY . /app
|
| 15 |
WORKDIR /app
|
| 16 |
|
| 17 |
-
# Expose port
|
| 18 |
-
EXPOSE
|
| 19 |
|
| 20 |
-
# Run the FastAPI app
|
| 21 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
| 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"]
|