Repository navigation
[Misc] move text-to-audio online examples to a unified folder - #4807
hsliuustc0106 merged 4 commits into
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
fa3720a to
1cda88d
Compare
|
@princepride Hi zp, I made the online text-to-audio migration based on conversation in #4607 . Can you take a look? |
|
@zzehli sorry for late review, can you resolve the conflicts? |
1cda88d to
3a3b06c
Compare
|
@princepride Resolved the merge conf. Can you take another look? |
3a3b06c to
bd530f1
Compare
|
@princepride I rebased this PR to main. It's ready to be viewed/merged. |
There was a problem hiding this comment.
Pull request overview
This PR consolidates the per-model online-serving examples for text/video-to-audio diffusion into a single task folder (examples/online_serving/text_to_audio/), aligning the repository’s example structure with other unified task entrypoints and updating docs/recipes accordingly.
Changes:
- Moved Stable Audio Open and AudioX online-serving scripts into a unified
text_to_audioexample folder with a combined README and per-model server/curl helpers. - Removed legacy per-model online-serving example directories and bespoke Python clients for Stable Audio and AudioX.
- Added a new Stable Audio online E2E test and updated docs navigation + recipe links to point at the unified folder.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/online_serving/test_stable_audio_online_expansion.py | Adds Stable Audio Open online-serving E2E test for /v1/audio/generate. |
| recipes/StabilityAI/Stable-Audio-Open.md | Repoints recipe links/paths to the unified text_to_audio online example folder. |
| recipes/audiox/AudioX.md | Repoints AudioX recipe to the unified text_to_audio online example folder. |
| examples/online_serving/text_to_audio/run_server_stable_audio.sh | Adds Stable Audio Open server launch helper for /v1/audio/generate. |
| examples/online_serving/text_to_audio/run_server_audiox.sh | Updates AudioX server launch helper with clarified requirements. |
| examples/online_serving/text_to_audio/run_curl_stable_audio.sh | Adds Stable Audio Open curl helper that saves binary audio output. |
| examples/online_serving/text_to_audio/run_curl_audiox.sh | Adds AudioX curl helper that posts chat-completions + decodes base64 WAV. |
| examples/online_serving/text_to_audio/README.md | Adds unified README documenting both models’ online-serving flows. |
| examples/online_serving/stable_audio/stable_audio_client.py | Removes legacy Stable Audio Python client. |
| examples/online_serving/stable_audio/README.md | Removes legacy Stable Audio per-model README. |
| examples/online_serving/stable_audio/curl_examples.sh | Removes legacy Stable Audio curl examples script. |
| examples/online_serving/audiox/README.md | Removes legacy AudioX per-model README. |
| examples/online_serving/audiox/openai_chat_client.py | Removes legacy AudioX Python client. |
| docs/user_guide/examples/online_serving/text_to_audio.md | Updates user guide page to cover both models and include new scripts. |
| docs/.nav.yml | Adds missing nav entry for the text-to-audio online serving page. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| pytest.param( | ||
| OmniServerParams(model=model), | ||
| id="t2a", | ||
| marks=SINGLE_CARD_FEATURE_MARKS, | ||
| ), |
| responses = openai_client.send_audio_generate_http_request(request_config) | ||
| assert responses, "no response from /v1/audio/generate" | ||
| resp = responses[0] | ||
| assert resp.success, f"audio generate failed: {resp.status_code} {resp.error_message}" | ||
| assert resp.status_code == 200 |
| read -r -d '' PAYLOAD <<EOF || true | ||
| { | ||
| "input": "${PROMPT}", | ||
| "negative_prompt": "${NEGATIVE_PROMPT}", | ||
| "audio_length": ${AUDIO_LENGTH}, | ||
| "guidance_scale": ${GUIDANCE_SCALE}, | ||
| "num_inference_steps": ${NUM_INFERENCE_STEPS}, | ||
| "seed": ${SEED}, | ||
| "response_format": "${RESPONSE_FORMAT}" | ||
| } | ||
| EOF |
| responses = openai_client.send_audio_generate_http_request(request_config) | ||
| assert responses, "no response from /v1/audio/generate" | ||
| resp = responses[0] | ||
| assert resp.success, f"audio generate failed: {resp.status_code} {resp.error_message}" |
There was a problem hiding this comment.
The assertions stop at HTTP success, but HttpResponse doesn't carry the response body — a 200 with an empty or non-WAV body would pass, while the docstring promises a non-empty WAV. Consider capturing r.content on HttpResponse in _http_response_from_requests and asserting non-empty + RIFF magic (mirrors assert_audio_valid in the offline test).
|
|
||
| read -r -d '' PAYLOAD <<EOF || true | ||
| { | ||
| "input": "${PROMPT}", |
There was a problem hiding this comment.
PROMPT/NEGATIVE_PROMPT are string-interpolated into the JSON heredoc, so a value containing a double quote or backslash produces invalid JSON and a 400 from the server. The sibling run_curl_audiox.sh and the text_to_video curl scripts build payloads with jq -n --arg; doing the same here would make env overrides safe.
There was a problem hiding this comment.
LGTM. Examples/docs migration matches the RFC #4539 pattern and the e2e wiring mirrors the AudioX counterpart; the two inline comments are non-blocking nits.
Signed-off-by: zzehli <jaeli_ottawa@outlook.com>
Signed-off-by: zzehli <jaeli_ottawa@outlook.com>
Signed-off-by: zzehli <jaeli_ottawa@outlook.com>
Signed-off-by: zzehli <jaeli_ottawa@outlook.com>
Head branch was pushed to by a user without write access
c4b087e to
5ba9712
Compare
|
remove audiox changes since it's no longer supported |
|
@princepride @hsliuustc0106 I removed audioX docs from the PR since it's no longer supported. Can you merge it again? |
…roject#4807) Signed-off-by: zzehli <jaeli_ottawa@outlook.com> Signed-off-by: AndyZhou952 <jzhoubc@connect.ust.hk>
…roject#4807) Signed-off-by: zzehli <jaeli_ottawa@outlook.com>
…roject#4807) Signed-off-by: zzehli <jaeli_ottawa@outlook.com>
Sub-task of #4539.
Purpose
Migrate the per-model online-serving examples for the two text/video-to-audio diffusion models into a single shared task folder, matching the structure of
examples/online_serving/text_to_videoand aligning with the RFC's "one standard task entrypoint per task" goal.examples/online_serving/audiox/andexamples/online_serving/stable_audio/into one folder:examples/online_serving/text_to_audio/.text_to_video):stabilityai/stable-audio-open-1.0) →POST /v1/audio/generate(JSON in, binary WAV out):run_server_stable_audio.sh,run_curl_stable_audio.sh.zhangj1an/AudioX) →POST /v1/chat/completionswith--model-class-name AudioXPipeline; task/sampler knobs declared invllm_omni/model_extras/audiox.pyare passed viaextra_body, and the base64 WAV is decoded fromchoices[0].message.audio.data:run_server_audiox.sh,run_curl_audiox.sh(TASK-driven:t2a/t2m/v2a/v2m/tv2a/tv2m, with local videos inlined as adata:video/mp4;base64,...URI forv2*/tv2*).README.mdcovering both models (start-server + curl recipes, the AudioXextra_bodyknob table, and a pointer to the shared offline entrypoint).openai_chat_client.py,stable_audio_client.py).tests/e2e/online_serving/test_stable_audio_online_expansion.py) so both migrated models are exercised on their standard online path; AudioX already hadtest_audiox_expansion.py.docs/user_guide/examples/online_serving/text_to_audio.md(now covers both models +--8<--includes the new scripts), adds the missing nav entry indocs/.nav.yml, and repointsrecipes/StabilityAI/Stable-Audio-Open.mdandrecipes/audiox/AudioX.mdat the new folder.No engine/serving code changed — this is an examples + docs + tests migration; the legacy fallback in the serving layer is untouched per the RFC's incremental-transition note.
Test
vLLM Version: 0.24.0
vLLM-Omni Commit: fa3720a
See attachments for online-serving stable audio and audiox result. They are generated with the following commands.
Archive.zip
Run audiox server:
Curl results:
Run stable audio server:
Curl results: