Tomtom84 commited on
Commit
c700bd5
·
verified ·
1 Parent(s): 1d792aa

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -22
Dockerfile CHANGED
@@ -1,39 +1,30 @@
1
- # GPU‑fertige Basis mit Python 3.10, CUDA 12.1, cuDNN 8
2
  FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
3
 
4
- # System‑Tools (schlank halten!)
5
  RUN apt-get update && \
6
- apt-get install -y git-lfs build-essential bash \
7
- git \
8
- wget curl procps gnupg \
9
- cmake \
10
- htop vim nano && \
11
  rm -rf /var/lib/apt/lists/*
12
 
13
- # NonrootUser, weil Spaces das mögen
14
  RUN useradd -m -u 1000 user
15
  USER user
16
  WORKDIR /app
17
  ENV PATH="/home/user/.local/bin:$PATH"
18
- #ENV HF_HOME=/app/.cache # HF‑Cache in deinem Schreib­verzeichnis
19
 
20
  # Python-Abhängigkeiten
21
  COPY --chown=user requirements.txt .
22
  RUN pip install --upgrade pip && \
23
  pip install --no-cache-dir -r requirements.txt
24
 
25
- # Optional: flash‑attn (Ampere 86 wird erkannt, Wheel vorhanden)
26
- # fertiges Wheel laden (kein nvcc)
27
- RUN pip install --no-cache-dir \
28
- https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.2cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
29
-
30
- # Mount das geheime HF‑Token beim Build:
31
- # Settings → Secrets → Name: HF_TOKEN (scope: "read")
32
- #ARG HF_TOKEN
33
- #RUN --mount=type=secret,id=HF_TOKEN \
34
- # echo "machine huggingface.co login __token__ password $(cat /run/secrets/HF_TOKEN)" > ~/.netrc
35
-
36
- # App‑Code
37
  COPY --chown=user . /app
38
 
39
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
1
+ # PyTorch + CUDA 12.1 + cuDNN 8 (passt zur L4)
2
  FROM pytorch/pytorch:2.2.2-cuda12.1-cudnn8-runtime
3
 
4
+ # -- System-Pakete minimal, aber was wir wirklich brauchen --
5
  RUN apt-get update && \
6
+ apt-get install -y --no-install-recommends \
7
+ git-lfs build-essential portaudio19-dev ffmpeg && \
 
 
 
8
  rm -rf /var/lib/apt/lists/*
9
 
10
+ # Non-root-User (Spaces-Empfehlung)
11
  RUN useradd -m -u 1000 user
12
  USER user
13
  WORKDIR /app
14
  ENV PATH="/home/user/.local/bin:$PATH"
 
15
 
16
  # Python-Abhängigkeiten
17
  COPY --chown=user requirements.txt .
18
  RUN pip install --upgrade pip && \
19
  pip install --no-cache-dir -r requirements.txt
20
 
21
+ # Orpheus-/SNAC-Code + Server
 
 
 
 
 
 
 
 
 
 
 
22
  COPY --chown=user . /app
23
 
24
+ # GPU-freundliches Torch-Upgrade (falls gewünscht)
25
+ RUN pip install --no-cache-dir \
26
+ torch==2.3.1+cu121 torchaudio==2.3.1 \
27
+ --index-url https://download.pytorch.org/whl/cu121
28
+
29
+ EXPOSE 7860
30
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]