Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +11 -12
Dockerfile
CHANGED
|
@@ -1,5 +1,3 @@
|
|
| 1 |
-
# Updated Dockerfile for debugging
|
| 2 |
-
|
| 3 |
FROM python:3.11-slim
|
| 4 |
|
| 5 |
# Install system dependencies
|
|
@@ -7,7 +5,6 @@ RUN apt-get update && apt-get install -y \
|
|
| 7 |
git curl build-essential cmake \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
# Set working directory
|
| 11 |
WORKDIR /app
|
| 12 |
|
| 13 |
# Create writable directories
|
|
@@ -16,23 +13,25 @@ RUN mkdir -p /app/.cache /app/vector_database && chmod -R 777 /app
|
|
| 16 |
# Set environment variables
|
| 17 |
ENV TRANSFORMERS_CACHE=/app/.cache \
|
| 18 |
HF_HOME=/app/.cache \
|
| 19 |
-
CHROMADB_DISABLE_TELEMETRY=true
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# Install Python dependencies
|
| 22 |
COPY requirements.txt .
|
|
|
|
| 23 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
|
| 25 |
# Copy the application code
|
| 26 |
COPY . .
|
| 27 |
|
| 28 |
-
# Download
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
ls -lh /app/dop-phi-1.5-Q4_K_M.gguf
|
| 36 |
|
| 37 |
# Expose the application port
|
| 38 |
EXPOSE 7860
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
# Install system dependencies
|
|
|
|
| 5 |
git curl build-essential cmake \
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
|
|
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
# Create writable directories
|
|
|
|
| 13 |
# Set environment variables
|
| 14 |
ENV TRANSFORMERS_CACHE=/app/.cache \
|
| 15 |
HF_HOME=/app/.cache \
|
| 16 |
+
CHROMADB_DISABLE_TELEMETRY=true \
|
| 17 |
+
# This flag tells pip to build llama-cpp-python for CPU only
|
| 18 |
+
CMAKE_ARGS="-DLLAMA_CUBLAS=OFF"
|
| 19 |
|
| 20 |
# Install Python dependencies
|
| 21 |
COPY requirements.txt .
|
| 22 |
+
# Use --no-cache-dir for smaller image size
|
| 23 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
|
| 25 |
# Copy the application code
|
| 26 |
COPY . .
|
| 27 |
|
| 28 |
+
# --- IMPROVED: Download and Verify Model ---
|
| 29 |
+
# The -f flag makes curl fail with an error if the download fails.
|
| 30 |
+
# The `&&` ensures that ls is only run if curl succeeds.
|
| 31 |
+
RUN curl -fL -o /app/dop-phi-1.5-Q4_K_M.gguf \
|
| 32 |
+
https://huggingface.co/Kalpokoch/QuantizedFineTunedPhi1.5/resolve/main/dop-phi-1.5-Q4_K_M.gguf \
|
| 33 |
+
&& echo "✅ Model downloaded. Verifying file size:" \
|
| 34 |
+
&& ls -lh /app/dop-phi-1.5-Q4_K_M.gguf
|
|
|
|
| 35 |
|
| 36 |
# Expose the application port
|
| 37 |
EXPOSE 7860
|