Spaces:
Build error
Build error
Enoch Jason J
commited on
Commit
·
bd9f042
1
Parent(s):
b5723ae
Changed Dockerfile
Browse files- Dockerfile +8 -15
Dockerfile
CHANGED
|
@@ -5,31 +5,24 @@ FROM python:3.11-slim
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# --- Installation ---
|
| 8 |
-
# Copy the local requirements file and the model downloader script
|
| 9 |
COPY requirements_local.txt .
|
| 10 |
COPY download_models.py .
|
| 11 |
-
|
| 12 |
-
# Install Python dependencies
|
| 13 |
RUN pip install --no-cache-dir -r requirements_local.txt
|
| 14 |
|
| 15 |
-
# --- Pre-download and Cache Models
|
| 16 |
-
# This
|
| 17 |
-
# The
|
| 18 |
-
|
|
|
|
| 19 |
RUN --mount=type=cache,target=/root/.cache/huggingface \
|
| 20 |
-
|
| 21 |
|
| 22 |
# Copy the main application code
|
| 23 |
-
COPY
|
| 24 |
-
|
| 25 |
-
# IMPORTANT: If your LoRA adapter is a local folder, you need to copy it in.
|
| 26 |
-
# For example:
|
| 27 |
-
# COPY ./my_local_lora_adapter /app/my_local_lora_adapter
|
| 28 |
-
# Then, in main.py, set LORA_ADAPTER_PATH = "/app/my_local_lora_adapter"
|
| 29 |
|
| 30 |
# Expose the port the app runs on
|
| 31 |
EXPOSE 8000
|
| 32 |
|
| 33 |
# Command to run the application
|
| 34 |
-
CMD ["uvicorn", "
|
| 35 |
|
|
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# --- Installation ---
|
|
|
|
| 8 |
COPY requirements_local.txt .
|
| 9 |
COPY download_models.py .
|
|
|
|
|
|
|
| 10 |
RUN pip install --no-cache-dir -r requirements_local.txt
|
| 11 |
|
| 12 |
+
# --- Pre-download and Cache Models ---
|
| 13 |
+
# FIX: This RUN command is now simplified.
|
| 14 |
+
# The HUGGING_FACE_HUB_TOKEN is automatically provided as an environment variable
|
| 15 |
+
# by the Hugging Face Spaces secrets manager. The python script will read it directly.
|
| 16 |
+
# The ARG line is no longer needed.
|
| 17 |
RUN --mount=type=cache,target=/root/.cache/huggingface \
|
| 18 |
+
python download_models.py
|
| 19 |
|
| 20 |
# Copy the main application code
|
| 21 |
+
COPY main.py .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
# Expose the port the app runs on
|
| 24 |
EXPOSE 8000
|
| 25 |
|
| 26 |
# Command to run the application
|
| 27 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
| 28 |
|