File size: 1,281 Bytes
612d5fa
0e659dc
9b0d2e3
49a7cb9
9b0d2e3
612d5fa
fc4387a
612d5fa
9b0d2e3
896a29d
 
 
49a7cb9
896a29d
 
768f22f
3ed620f
 
8f2f2ae
9cc5faf
 
 
d93120d
fc4387a
9cc5faf
 
 
 
fc4387a
8f2f2ae
fc4387a
 
49a7cb9
d93120d
53af45f
fc4387a
612d5fa
5063f68
a6a9036
 
9cc5faf
9b0d2e3
 
 
fc4387a
0e659dc
 
 
 
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM python:3.10-slim

# -----------------------------
# SYSTEM
# -----------------------------
RUN apt-get update && apt-get install -y \
    git wget curl bash build-essential cmake dos2unix \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# -----------------------------
# PYTHON
# -----------------------------
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# -----------------------------
# ENV
# -----------------------------
ENV HF_HOME=/tmp/hf_cache
ENV APEX_DIR=/app/apex-quant
ENV PATH="/usr/local/bin:$PATH"
ENV LLAMA_QUANTIZE=/usr/local/bin/llama-quantize

RUN mkdir -p /tmp/hf_cache

# -----------------------------
# llama-quantize (ONLY RELIABLE PART)
# -----------------------------
RUN curl -L -o /usr/local/bin/llama-quantize \
    https://github.com/ggerganov/llama.cpp/releases/download/b4960/llama-quantize && \
    chmod +x /usr/local/bin/llama-quantize

# -----------------------------
# apex-quant (ONLY FOR PROFILES)
# -----------------------------
RUN git clone --depth 1 https://github.com/innokria/apex-quant.git /app/apex-quant

RUN chmod +x /app/apex-quant/scripts/quantize.sh || true

# -----------------------------
# APP
# -----------------------------
COPY app.py /app/app.py

EXPOSE 7860

CMD ["python3", "app.py"]