Skip to content

Commit f515168

Browse files
localai-botmudler
andauthored
chore(acestep-cpp): bump pin to ed53caf and adapt wrapper to new API (#9908)
The new ace-step.cpp revision moves backend initialization inside each `*_load` call and drops the separate `DiTGGMLConfig` argument from `dit_ggml_load` (config now lives in `DiTGGML::cfg`, populated from GGUF metadata at load time). Drop the now-removed `*_init_backend` calls and replace `g_dit_cfg` accesses with `g_dit.cfg`. Assisted-by: Claude:claude-opus-4-7 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
1 parent ef6ca34 commit f515168

2 files changed

Lines changed: 14 additions & 18 deletions

File tree

backend/go/acestep-cpp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ JOBS?=$(shell nproc --ignore=1)
88

99
# acestep.cpp version
1010
ACESTEP_REPO?=https://github.com/ace-step/acestep.cpp
11-
ACESTEP_CPP_VERSION?=e0c8d75a672fca5684c88c68dbf6d12f58754258
11+
ACESTEP_CPP_VERSION?=ed53caf164e4492a5620b2e3f2264629cf66da24
1212
SO_TARGET?=libgoacestepcpp.so
1313

1414
CMAKE_ARGS+=-DBUILD_SHARED_LIBS=OFF

backend/go/acestep-cpp/cpp/goacestepcpp.cpp

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
#include <vector>
2323

2424
// Global model contexts (loaded once, reused across requests)
25-
static DiTGGML g_dit = {};
26-
static DiTGGMLConfig g_dit_cfg;
27-
static VAEGGML g_vae = {};
28-
static bool g_dit_loaded = false;
29-
static bool g_vae_loaded = false;
30-
static bool g_is_turbo = false;
25+
static DiTGGML g_dit = {};
26+
static VAEGGML g_vae = {};
27+
static bool g_dit_loaded = false;
28+
static bool g_vae_loaded = false;
29+
static bool g_is_turbo = false;
3130

3231
// Silence latent [15000, 64] — read once from DiT GGUF
3332
static std::vector<float> g_silence_full;
@@ -72,10 +71,9 @@ int load_model(const char * lm_model_path, const char * text_encoder_path,
7271
g_text_enc_path = text_encoder_path;
7372
g_dit_path = dit_model_path;
7473

75-
// Load DiT model
74+
// Load DiT model (backend init + config are handled inside dit_ggml_load)
7675
fprintf(stderr, "[acestep-cpp] Loading DiT from %s\n", dit_model_path);
77-
dit_ggml_init_backend(&g_dit);
78-
if (!dit_ggml_load(&g_dit, dit_model_path, g_dit_cfg, nullptr, 0.0f)) {
76+
if (!dit_ggml_load(&g_dit, dit_model_path)) {
7977
fprintf(stderr, "[acestep-cpp] FATAL: failed to load DiT from %s\n", dit_model_path);
8078
return 1;
8179
}
@@ -149,16 +147,16 @@ int generate_music(const char * caption, const char * lyrics, int bpm,
149147

150148
// Compute T (latent frames at 25Hz)
151149
int T = (int)(duration * FRAMES_PER_SECOND);
152-
T = ((T + g_dit_cfg.patch_size - 1) / g_dit_cfg.patch_size) * g_dit_cfg.patch_size;
153-
int S = T / g_dit_cfg.patch_size;
150+
T = ((T + g_dit.cfg.patch_size - 1) / g_dit.cfg.patch_size) * g_dit.cfg.patch_size;
151+
int S = T / g_dit.cfg.patch_size;
154152

155153
if (T > 15000) {
156154
fprintf(stderr, "[acestep-cpp] ERROR: T=%d exceeds max 15000\n", T);
157155
return 2;
158156
}
159157

160-
int Oc = g_dit_cfg.out_channels; // 64
161-
int ctx_ch = g_dit_cfg.in_channels - Oc; // 128
158+
int Oc = g_dit.cfg.out_channels; // 64
159+
int ctx_ch = g_dit.cfg.in_channels - Oc; // 128
162160

163161
fprintf(stderr, "[acestep-cpp] T=%d, S=%d, duration=%.1fs, seed=%d\n", T, S, duration, seed);
164162

@@ -191,9 +189,8 @@ int generate_music(const char * caption, const char * lyrics, int bpm,
191189

192190
fprintf(stderr, "[acestep-cpp] caption: %d tokens, lyrics: %d tokens\n", S_text, S_lyric);
193191

194-
// 4. Text encoder forward
192+
// 4. Text encoder forward (backend init handled inside qwen3_load_text_encoder)
195193
Qwen3GGML text_enc = {};
196-
qwen3_init_backend(&text_enc);
197194
if (!qwen3_load_text_encoder(&text_enc, g_text_enc_path.c_str())) {
198195
fprintf(stderr, "[acestep-cpp] FATAL: failed to load text encoder\n");
199196
return 4;
@@ -209,9 +206,8 @@ int generate_music(const char * caption, const char * lyrics, int bpm,
209206
std::vector<float> lyric_embed(H_text * S_lyric);
210207
qwen3_embed_lookup(&text_enc, lyric_ids.data(), S_lyric, lyric_embed.data());
211208

212-
// 6. Condition encoder
209+
// 6. Condition encoder (backend init handled inside cond_ggml_load)
213210
CondGGML cond = {};
214-
cond_ggml_init_backend(&cond);
215211
if (!cond_ggml_load(&cond, g_dit_path.c_str())) {
216212
fprintf(stderr, "[acestep-cpp] FATAL: failed to load condition encoder\n");
217213
qwen3_free(&text_enc);

0 commit comments

Comments
 (0)