diff --git a/src/code-predictor-forward.h b/src/code-predictor-forward.h index 8f39822..4265f63 100644 --- a/src/code-predictor-forward.h +++ b/src/code-predictor-forward.h @@ -240,6 +240,7 @@ static bool code_predictor_run(const CodePredictorWeights * cw, ggml_set_output(logits); ggml_build_forward_expand(gf, logits); + ggml_backend_sched_reset(sched); if (!ggml_backend_sched_alloc_graph(sched, gf)) { fprintf(stderr, "[CodePredictor] FATAL: graph allocation failed\n"); ggml_backend_sched_reset(sched); diff --git a/src/prompt-builder.h b/src/prompt-builder.h index 4feee96..1a8409e 100644 --- a/src/prompt-builder.h +++ b/src/prompt-builder.h @@ -161,6 +161,7 @@ static bool project_text_ids_backend(PipelineTTS * pt, const int32_t * ids, int struct ggml_cgraph * graph = ggml_new_graph_custom(gctx, max_nodes, false); ggml_build_forward_expand(graph, out); + ggml_backend_sched_reset(pt->sched); if (!ggml_backend_sched_alloc_graph(pt->sched, graph)) { ggml_backend_sched_reset(pt->sched); ggml_free(gctx); @@ -244,6 +245,7 @@ static void project_ref_codes_backend(PipelineTTS * pt, const int32_t * ref_code struct ggml_cgraph * graph = ggml_new_graph_custom(gctx, max_nodes, false); ggml_build_forward_expand(graph, sum); + ggml_backend_sched_reset(pt->sched); if (!ggml_backend_sched_alloc_graph(pt->sched, graph)) { ggml_backend_sched_reset(pt->sched); ggml_free(gctx);