Nekochu commited on
Commit
fccaf48
·
1 Parent(s): fe00878

switch to acestep.cpp GGUF: XL turbo Q4_K_M + 4B LM Q5_K_M

Browse files
Files changed (4) hide show
  1. .dockerignore +7 -0
  2. Dockerfile +83 -0
  3. README.md +2 -4
  4. start.sh +31 -0
.dockerignore ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ .git
2
+ __pycache__
3
+ *.pyc
4
+ *.pyo
5
+ ace-step-source
6
+ checkpoints
7
+ lora_output
Dockerfile ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04 AS builder
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ build-essential cmake git ca-certificates libopenblas-dev \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ WORKDIR /build
10
+
11
+ # Clone acestep.cpp and init submodules
12
+ RUN git clone --depth 1 https://github.com/ServeurpersoCom/acestep.cpp.git . \
13
+ && git submodule update --init --depth 1
14
+
15
+ # Build CPU-only with BLAS (-j1 to avoid OOM on HF free tier)
16
+ RUN mkdir build && cd build \
17
+ && cmake .. -DGGML_BLAS=ON \
18
+ && cmake --build . --config Release -j1
19
+
20
+ # Stage built artifacts into a clean directory for COPY
21
+ RUN mkdir -p /artifacts \
22
+ && cp /build/build/ace-server /artifacts/ \
23
+ && cp /build/build/ace-lm /artifacts/ \
24
+ && cp /build/build/ace-synth /artifacts/ \
25
+ && (cp /build/build/libggml*.so /artifacts/ 2>/dev/null || true)
26
+
27
+ # ---------------------------------------------------------------------------
28
+ # Runtime image
29
+ # ---------------------------------------------------------------------------
30
+ FROM ubuntu:22.04
31
+
32
+ ENV DEBIAN_FRONTEND=noninteractive
33
+
34
+ RUN apt-get update && apt-get install -y --no-install-recommends \
35
+ libopenblas0 libgomp1 ca-certificates \
36
+ python3 python3-pip curl \
37
+ && rm -rf /var/lib/apt/lists/*
38
+
39
+ WORKDIR /app
40
+
41
+ # Copy built binaries and shared libraries
42
+ COPY --from=builder /artifacts/ /app/
43
+
44
+ # Ensure GGML backend .so files are findable at runtime
45
+ ENV LD_LIBRARY_PATH=/app:${LD_LIBRARY_PATH}
46
+
47
+ # Make binaries executable
48
+ RUN chmod +x /app/ace-server /app/ace-lm /app/ace-synth
49
+
50
+ # Create model and adapter directories
51
+ RUN mkdir -p /app/models /app/adapters /app/outputs
52
+
53
+ # Download GGUF models at build time (NOT via Git LFS)
54
+ # --fail ensures curl returns non-zero on HTTP errors (catches 404)
55
+
56
+ # XL DiT turbo Q4_K_M (~2.8GB) - best quality/size for CPU
57
+ RUN curl -fL --retry 3 --retry-delay 5 -o /app/models/acestep-v15-xl-turbo-Q4_K_M.gguf \
58
+ "https://huggingface.co/Serveurperso/ACE-Step-1.5-GGUF/resolve/main/acestep-v15-xl-turbo-Q4_K_M.gguf"
59
+
60
+ # LM 4B Q5_K_M (~2.9GB) - best quality
61
+ RUN curl -fL --retry 3 --retry-delay 5 -o /app/models/acestep-5Hz-lm-4B-Q5_K_M.gguf \
62
+ "https://huggingface.co/Serveurperso/ACE-Step-1.5-GGUF/resolve/main/acestep-5Hz-lm-4B-Q5_K_M.gguf"
63
+
64
+ # Text encoder Q8_0 (~0.75GB)
65
+ RUN curl -fL --retry 3 --retry-delay 5 -o /app/models/Qwen3-Embedding-0.6B-Q8_0.gguf \
66
+ "https://huggingface.co/Serveurperso/ACE-Step-1.5-GGUF/resolve/main/Qwen3-Embedding-0.6B-Q8_0.gguf"
67
+
68
+ # VAE BF16 (~0.32GB) - always BF16, quality-critical
69
+ RUN curl -fL --retry 3 --retry-delay 5 -o /app/models/vae-BF16.gguf \
70
+ "https://huggingface.co/Serveurperso/ACE-Step-1.5-GGUF/resolve/main/vae-BF16.gguf"
71
+
72
+ # Install Python deps for Gradio UI
73
+ RUN pip3 install --no-cache-dir gradio==5.29.0 requests
74
+
75
+ # Copy application files
76
+ COPY app.py /app/app.py
77
+ COPY start.sh /app/start.sh
78
+ RUN chmod +x /app/start.sh
79
+
80
+ # HF Spaces expects port 7860
81
+ EXPOSE 7860
82
+
83
+ CMD ["/app/start.sh"]
README.md CHANGED
@@ -3,10 +3,8 @@ title: ACE Step CPU
3
  emoji: 🎵
4
  colorFrom: indigo
5
  colorTo: yellow
6
- sdk: gradio
7
- sdk_version: 6.13.0
8
- app_file: app.py
9
  pinned: false
10
  ---
11
 
12
- ACE-Step CPU
 
3
  emoji: 🎵
4
  colorFrom: indigo
5
  colorTo: yellow
6
+ sdk: docker
 
 
7
  pinned: false
8
  ---
9
 
10
+ ACE-Step 1.5 XL Music Generation (CPU) powered by acestep.cpp GGUF inference.
start.sh ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ echo "[start] Launching ace-server on port 8085..."
5
+ /app/ace-server \
6
+ --host 127.0.0.1 \
7
+ --port 8085 \
8
+ --models /app/models \
9
+ --adapters /app/adapters \
10
+ --max-batch 1 \
11
+ &
12
+
13
+ ACE_PID=$!
14
+ echo "[start] ace-server PID: $ACE_PID"
15
+
16
+ # Wait for server to become healthy
17
+ echo "[start] Waiting for ace-server health..."
18
+ for i in $(seq 1 60); do
19
+ if curl -sf http://127.0.0.1:8085/health > /dev/null 2>&1; then
20
+ echo "[start] ace-server is healthy."
21
+ break
22
+ fi
23
+ if ! kill -0 $ACE_PID 2>/dev/null; then
24
+ echo "[start] ERROR: ace-server exited prematurely."
25
+ exit 1
26
+ fi
27
+ sleep 2
28
+ done
29
+
30
+ echo "[start] Launching Gradio UI on port 7860..."
31
+ exec python3 /app/app.py