Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +24 -9
Dockerfile
CHANGED
|
@@ -1,25 +1,40 @@
|
|
| 1 |
-
|
| 2 |
|
|
|
|
|
|
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y \
|
| 4 |
-
curl build-essential cmake \
|
| 5 |
&& rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
WORKDIR /app
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
ENV TRANSFORMERS_CACHE=/app/.cache \
|
| 10 |
HF_HOME=/app/.cache \
|
| 11 |
-
CHROMADB_DISABLE_TELEMETRY=true
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
| 13 |
|
|
|
|
| 14 |
COPY requirements.txt .
|
| 15 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
-
|
| 18 |
-
COPY
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
RUN
|
|
|
|
|
|
|
| 22 |
|
|
|
|
| 23 |
EXPOSE 7860
|
| 24 |
|
| 25 |
-
|
|
|
|
|
|
| 1 |
+
# This Dockerfile uses your original, fast-building pattern.
|
| 2 |
|
| 3 |
+
FROM python:3.11-slim
|
| 4 |
+
|
| 5 |
+
# Install system dependencies
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
+
git curl build-essential cmake \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
+
# Create writable directories
|
| 13 |
+
RUN mkdir -p /app/.cache /app/vector_database && chmod -R 777 /app
|
| 14 |
+
|
| 15 |
+
# Set environment variables
|
| 16 |
ENV TRANSFORMERS_CACHE=/app/.cache \
|
| 17 |
HF_HOME=/app/.cache \
|
| 18 |
+
CHROMADB_DISABLE_TELEMETRY=true
|
| 19 |
+
|
| 20 |
+
# Pre-install the specific, known-working version of llama-cpp-python
|
| 21 |
+
# This version matches the tool version used to create your new GGUF file.
|
| 22 |
+
RUN pip install --no-cache-dir llama-cpp-python==0.2.61
|
| 23 |
|
| 24 |
+
# Install the rest of the dependencies
|
| 25 |
COPY requirements.txt .
|
| 26 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
|
| 28 |
+
# Copy the application code
|
| 29 |
+
COPY . .
|
| 30 |
|
| 31 |
+
# <-- UPDATED: Download your new, compatible GGUF model from the new repo
|
| 32 |
+
RUN curl -fL -o /app/phi1.5_dop_q4_k_m.gguf \
|
| 33 |
+
https://huggingface.co/Kalpokoch/Phi1.5QuantizedFineTuned/resolve/main/phi1.5_dop_q4_k_m.gguf \
|
| 34 |
+
&& echo "✅ Model downloaded."
|
| 35 |
|
| 36 |
+
# Expose the application port
|
| 37 |
EXPOSE 7860
|
| 38 |
|
| 39 |
+
# Run the FastAPI application
|
| 40 |
+
CMD ["uvicorn", "app.app:app", "--host", "0.0.0.0", "--port", "7860"]
|