Kalpokoch commited on
Commit
f9e09d8
·
verified ·
1 Parent(s): 816d6d2

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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 your fine-tuned Phi-1.5 model
29
- RUN curl -L -o /app/dop-phi-1.5-Q4_K_M.gguf \
30
- https://huggingface.co/Kalpokoch/QuantizedFineTunedPhi1.5/resolve/main/dop-phi-1.5-Q4_K_M.gguf
31
-
32
- # --- ADDED: Verify the downloaded file ---
33
- # This command will show the file's size in the build logs.
34
- RUN echo "Verifying downloaded model file..." && \
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