File size: 941 Bytes
87a5b6f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.10-slim

# Install dependencies (procps for pkill when switching models)
RUN apt-get update && apt-get install -y \
    curl wget libgomp1 procps \
    && rm -rf /var/lib/apt/lists/*

# Download prebuilt llama.cpp
RUN mkdir -p /opt/llama && \
    wget -q https://github.com/ggml-org/llama.cpp/releases/download/b7789/llama-b7789-bin-ubuntu-x64.tar.gz -O /tmp/llama.tar.gz && \
    tar -xzf /tmp/llama.tar.gz -C /opt/llama --strip-components=1 && \
    chmod +x /opt/llama/* && \
    rm /tmp/llama.tar.gz

ENV PATH="/opt/llama:$PATH"
ENV LD_LIBRARY_PATH="/opt/llama:$LD_LIBRARY_PATH"

# Install Python packages (hf_xet for 10x faster downloads, lingua for auto lang detect)
RUN pip install --no-cache-dir gradio huggingface-hub hf_xet requests lingua-language-detector

# App files
WORKDIR /app
COPY app.py start.sh ./
RUN chmod +x start.sh

# Create models directory
RUN mkdir -p /models

EXPOSE 7860

CMD ["bash", "start.sh"]