File size: 2,385 Bytes
1c14aef
 
d7c0f8f
9a8f954
d7c0f8f
1c14aef
9a8f954
 
 
d7c0f8f
 
 
1c14aef
 
 
 
d7c0f8f
 
 
1c14aef
9a8f954
 
 
 
 
1c14aef
d7c0f8f
 
 
1c14aef
cfe682e
bced7ce
1c14aef
d7c0f8f
 
 
9a8f954
d7c0f8f
 
 
 
9a8f954
 
 
d7c0f8f
 
 
1c14aef
d7c0f8f
 
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
50
FROM python:3.11-slim

# ─────────────────────────────────────────────
# System deps (Compiladores incluΓ­dos aqui)
# ─────────────────────────────────────────────
RUN apt-get update && apt-get install -y \
    build-essential \
    cmake \
    python3-dev \
    libgl1 \
    libglib2.0-0 \
    wget \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# ─────────────────────────────────────────────
# Python deps
# ─────────────────────────────────────────────
COPY requirements.txt .

# ForΓ§amos a instalaΓ§Γ£o do llama-cpp-python sem tentar usar GPU
# e garantimos que ele seja compilado corretamente
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# ─────────────────────────────────────────────
# App files
# ─────────────────────────────────────────────
COPY main.py .
COPY yolo_deart.onnx .
COPY style_classifier.onnx .

# ─────────────────────────────────────────────
# HF / LLM performance config
# ─────────────────────────────────────────────
# No Space Free, o /tmp Γ© o melhor lugar para cache volΓ‘til
ENV HF_HOME=/tmp/huggingface
ENV TRANSFORMERS_CACHE=/tmp/huggingface
ENV TOKENIZERS_PARALLELISM=false

# Importante para o llama-cpp nΓ£o tentar usar AVX512 se o CPU nΓ£o suportar
ENV CMAKE_ARGS="-DLLAMA_BLAS=OFF -DLLAMA_CUDA=OFF"

# ─────────────────────────────────────────────
# Port
# ─────────────────────────────────────────────
EXPOSE 7860

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]