Skip to content

Yue2 "stop after" (generate just score.abc, or semantic) - #636

Merged
0xShug0 merged 1 commit into
0xShug0:mainfrom
engival:yue2-stop-after
Sep 22, 2026
Merged

0xShug0 merged 1 commit into
0xShug0:mainfrom
engival:yue2-stop-after

Conversation

@engival

@engival engival commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

This gives you the ability to generate just a score.abc, or the score + semantic, while skipping the final audio render.

  • Use case: score-only and tokens-only runs.
    • Write a score once, then render it in several styles without paying for the NAR and VAE each time.
  • Two structural changes:
    • Yue2RunResult::audio became std::optional. Otherwise the CLI writes a header-only WAV.
    • The ABC stage moved verbatim into generate_plan_abc / attach_plan_abc, so the early return can share it.
  • Validation on Intel Arc / Vulkan:
    • A request without the option renders a byte-identical WAV to dev.
    • Feeding the exported score back through abc_file reproduces a byte-identical semantic.json.
    • stop_after=abc with cot=off is rejected, and so is stop_after=abc with a supplied score. The error messages are clear.
    • The three YuE2 path cases pass.
  • Limits:
    • A no-audio result works through /v1/tasks/run. It does not work through /v1/audio/speech, which requires audio and is left untouched.
    • There is no WebUI control.
    • It was not tested in the WebUI.

@engival
engival marked this pull request as ready for review September 21, 2026 23:56
@0xShug0

0xShug0 commented Sep 22, 2026

Copy link
Copy Markdown
Owner

@engival One issue should be fixed before merging:

stop_after=semantic does not automatically return the generated semantic tokens. With cot=off and no export_semantic=true, it runs semantic generation successfully and returns an entirely empty result: no audio or semantic artifact.

This also conflicts with the model-spec description, which says the semantic setting writes the semantic export. The clean fix is for stop_after=semantic to imply semantic export. At minimum, reject the request when it would produce no output.

stop_after=abc writes the score and stops; stop_after=semantic also runs the semantic stage and skips the NAR and the VAE, and implies export_semantic since the token stream is all that stage produces. Such a result carries no audio, only artifacts. Default audio: a request that does not set it renders as before. The ABC stage moves into a helper so the early return can use it; Yue2RunResult::audio becomes optional so no empty WAV is written.
@engival

engival commented Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

@0xShug0

Okay, it's done. stop_after now implies the export. The export flag is only required for getting the semantic at the same time as the wav.

@0xShug0
0xShug0 merged commit 2fff3c8 into 0xShug0:main Sep 22, 2026
6 checks passed
@0xShug0

0xShug0 commented Sep 22, 2026

Copy link
Copy Markdown
Owner

@engival Thanks! PR merged 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants