File size: 929 Bytes
70b22b3
 
 
 
 
 
 
 
d5b0826
70b22b3
 
d5b0826
 
 
70b22b3
 
 
 
 
 
 
 
 
 
 
d5b0826
70b22b3
97eb6a3
 
70b22b3
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Use slim Python base
FROM python:3.11-slim

# Install system dependencies
RUN apt-get update && \
    apt-get install -y git build-essential cmake wget curl && \
    rm -rf /var/lib/apt/lists/*

# Clone llama.cpp
RUN git clone https://github.com/ggml-org/llama.cpp.git /llama.cpp
WORKDIR /llama.cpp

# Build llama.cpp using CMake
RUN cmake -B build && cmake --build build

# Switch to app folder
WORKDIR /app
COPY app.py requirements.txt ./

# Make /app fully readable/writable/executable
RUN chmod -R 777 /app

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Download GGUF model at build time (replace with your GitHub/HF link)
RUN mkdir -p /app/model && \
    wget -O /app/model/model.gguf \
      "https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF/resolve/main/qwen2.5-coder-1.5b-instruct-q4_k_m.gguf"

# Expose port for Gradio
EXPOSE 7860

# Start app
CMD ["python", "app.py"]