Add a merge tool and docs for serving with sglang-omni

#1
by SunskyXH - opened

Summary

  • Add tools/merge_to_s2pro.py. It folds model/lora.safetensors (LoRA, r32) and model/adapter.safetensors (rsLoRA, r16) into fishaudio/s2-pro@1de9996b and 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' own merge_lora + RsLinear and 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 to AGENT_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 785f18384 serving the merged checkpoint, the 12 lines of examples/lines.jsonl with one shared reference (Space preset Female Voice 1): 20.3 s vs 223.8 s with infer.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

https://claude.ai/code/session_01NvCi8UM3SggKKspqEc7Xo5

SunskyXH changed pull request status to open
Cannot merge
This branch has merge conflicts in the following files:
  • AGENT_GUIDE.md

Sign up or log in to comment