Add a merge tool and docs for serving with sglang-omni
#1
by SunskyXH - opened
Summary
- Add
tools/merge_to_s2pro.py. It foldsmodel/lora.safetensors(LoRA, r32) andmodel/adapter.safetensors(rsLoRA, r16) intofishaudio/s2-pro@1de9996band writes a checkpoint with the same files, tensor names and shapes. Unmodified sglang-omni then serves Iroha-TTS-V1 through its own S2-Pro pipeline. Before writing anything, the script checks one merged projection against emotts' ownmerge_lora+RsLinearand stops if they differ by more than 1e-4. - Add a "Serving with sglang-omni" section to
README.md/README_zh.md, and a subsection plus a file-table row toAGENT_GUIDE.md: merge command, serve command, request format, and what this path lacks (guidance, intensity, float32).
Testing (one RTX 5090, WSL2)
- Default arguments with the cached S2-Pro: 308 LoRA pairs merged into 200 tensors, check error 3.7e-07, 61 s, peak RSS 14.8 GB. Both output shards are byte-identical to the checkpoint used in the runs below.
- The check rejects a wrong adapter scale (alpha/rank instead of alpha/sqrt(rank)): error 2.4e-03 against the 1e-4 limit.
- Unmodified sglang-omni
785f18384serving the merged checkpoint, the 12 lines ofexamples/lines.jsonlwith one shared reference (Space preset Female Voice 1): 20.3 s vs 223.8 s withinfer.py; whisper-large-v3 transcripts match on all 12 lines; WavLM speaker similarity 0.640 vs 0.641.
Comparison page with A/B audio: https://claude.ai/artifact/EXG4rmJsALPHoTRgELnzY5
π€ Generated with Claude Code
SunskyXH changed pull request status to open