Spaces:
Build error
Build error
File size: 1,053 Bytes
56b734d 63730eb 56b734d 63730eb | 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 | FROM python:3.12-slim-bookworm
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
HF_HOME=/opt/models \
TRANSFORMERS_CACHE=/opt/models \
HUGGINGFACE_HUB_CACHE=/opt/models
WORKDIR /code
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
wget \
curl \
ffmpeg \
libsndfile1 \
gcc \
g++ \
build-essential \
python3-dev \
pkg-config \
libsentencepiece-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
RUN python - <<PYEOF
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="nvidia/personaplex-7b-v1",
local_dir="/opt/models/personaplex",
local_dir_use_symlinks=False
)
print("Model downloaded successfully.")
PYEOF
COPY . .
EXPOSE 7860
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] |