Spaces:
Running on Zero
Running on Zero
Commit ·
1881421
1
Parent(s): bd0ded8
Revert to gradio SDK with runtime --no-deps SA3 install for ZeroGPU
Browse filesZeroGPU is only available on the gradio SDK, not Docker, so the Docker
approach is a dead end. Go back to sdk: gradio and keep stable-audio-tools
out of requirements.txt entirely (its pyproject hard-pins torch==2.7.1,
which ZeroGPU rejects). Instead app.py installs it at import time with
pip --no-cache-dir --no-deps, so the ZeroGPU-managed torch is used and
SA3's torch pin is never resolved. requirements.txt supplies all of SA3's
non-torch dependencies up front.
- README front-matter: sdk docker -> gradio (restore sdk_version/app_file)
- Remove Dockerfile
- app.py: add --no-cache-dir to the runtime SA3 install
- Dockerfile +0 -50
- README.md +4 -2
- app.py +2 -1
Dockerfile
DELETED
|
@@ -1,50 +0,0 @@
|
|
| 1 |
-
# CODA — HF Space (Docker SDK on ZeroGPU)
|
| 2 |
-
#
|
| 3 |
-
# Why Docker instead of the gradio SDK: stable-audio-tools hard-pins
|
| 4 |
-
# torch==2.7.1 in its pyproject.toml. ZeroGPU only accepts torch
|
| 5 |
-
# 2.8.0/2.9.1/2.10.0/2.11.0, so the gradio-SDK build fails resolving the pin.
|
| 6 |
-
# Here we install a ZeroGPU-compatible torch first, then install
|
| 7 |
-
# stable-audio-tools with --no-deps so its torch pin is ignored, and supply all
|
| 8 |
-
# of SA3's actual (non-torch) dependencies ourselves via requirements.txt.
|
| 9 |
-
|
| 10 |
-
FROM python:3.10-slim
|
| 11 |
-
|
| 12 |
-
# System libs: ffmpeg for audio I/O, libsndfile1 for soundfile, git so pip can
|
| 13 |
-
# install stable-audio-tools straight from its repo.
|
| 14 |
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 15 |
-
ffmpeg \
|
| 16 |
-
libsndfile1 \
|
| 17 |
-
git \
|
| 18 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 19 |
-
|
| 20 |
-
# HF Spaces convention: run as a non-root user with UID 1000.
|
| 21 |
-
RUN useradd -m -u 1000 user
|
| 22 |
-
USER user
|
| 23 |
-
ENV HOME=/home/user \
|
| 24 |
-
PATH=/home/user/.local/bin:$PATH \
|
| 25 |
-
PYTHONUNBUFFERED=1 \
|
| 26 |
-
HF_HOME=/home/user/.cache/huggingface \
|
| 27 |
-
GRADIO_SERVER_NAME=0.0.0.0 \
|
| 28 |
-
GRADIO_SERVER_PORT=7860
|
| 29 |
-
|
| 30 |
-
WORKDIR $HOME/app
|
| 31 |
-
|
| 32 |
-
# Install the Python deps first (own layer, so code edits don't bust the cache).
|
| 33 |
-
# requirements.txt pins torch==2.8.0+cu124 (ZeroGPU-compatible) plus every
|
| 34 |
-
# non-torch dependency SA3 needs.
|
| 35 |
-
COPY --chown=user:user requirements.txt .
|
| 36 |
-
RUN pip install --no-cache-dir --upgrade pip \
|
| 37 |
-
&& pip install --no-cache-dir -r requirements.txt
|
| 38 |
-
|
| 39 |
-
# Install stable-audio-tools WITHOUT its dependency tree, so its torch==2.7.1
|
| 40 |
-
# pin never gets resolved — the ZeroGPU-compatible torch above is used instead.
|
| 41 |
-
RUN pip install --no-cache-dir --no-deps \
|
| 42 |
-
git+https://github.com/Stability-AI/stable-audio-tools.git
|
| 43 |
-
|
| 44 |
-
# App code last.
|
| 45 |
-
COPY --chown=user:user . .
|
| 46 |
-
|
| 47 |
-
# HF Spaces serves the container on port 7860.
|
| 48 |
-
EXPOSE 7860
|
| 49 |
-
|
| 50 |
-
CMD ["python", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
|
@@ -3,8 +3,10 @@ title: CODA
|
|
| 3 |
emoji: 🎵
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: yellow
|
| 6 |
-
sdk:
|
| 7 |
-
|
|
|
|
|
|
|
| 8 |
pinned: false
|
| 9 |
license: mit
|
| 10 |
short_description: AI that finishes the song you quit on.
|
|
|
|
| 3 |
emoji: 🎵
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: yellow
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 6.16.0
|
| 8 |
+
python_version: '3.10'
|
| 9 |
+
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
license: mit
|
| 12 |
short_description: AI that finishes the song you quit on.
|
app.py
CHANGED
|
@@ -17,7 +17,8 @@ try:
|
|
| 17 |
import stable_audio_tools as _ # noqa: F401
|
| 18 |
del _
|
| 19 |
except ImportError:
|
| 20 |
-
_sp.check_call([_sys.executable, "-m", "pip", "install",
|
|
|
|
| 21 |
"git+https://github.com/Stability-AI/stable-audio-tools.git"])
|
| 22 |
del _sp, _sys
|
| 23 |
|
|
|
|
| 17 |
import stable_audio_tools as _ # noqa: F401
|
| 18 |
del _
|
| 19 |
except ImportError:
|
| 20 |
+
_sp.check_call([_sys.executable, "-m", "pip", "install",
|
| 21 |
+
"--no-cache-dir", "--no-deps", "-q",
|
| 22 |
"git+https://github.com/Stability-AI/stable-audio-tools.git"])
|
| 23 |
del _sp, _sys
|
| 24 |
|