[3/5][core]refactor communication layer: PR 3 of 5, all other models in non async mode (#3719)

Signed-off-by: natureofnature <wzliu@connect.hku.hk>
This commit is contained in:
NATURE authored and GitHub committed 2026-05-28 14:06:41 +08:00
1 parent 0f3264a9c0
commit 3a347b10b0
38 files changed
+3021 -275

No files matched your search

@@ -293,7 +293,13 @@ def test_code2wav_forward_finalizes_hift_tail():
model = object.__new__(CosyVoice3Code2Wav)
nn.Module.__init__(model)
model.hift = DummyHiFT()
model._forward_mel = lambda **_: torch.ones((1, 80, 8), dtype=torch.float32)
forward_mel_calls = []
def fake_forward_mel(**kwargs):
forward_mel_calls.append(kwargs)
return torch.ones((1, 80, 8), dtype=torch.float32)
model._forward_mel = fake_forward_mel
out = model.forward(
token=torch.tensor([[1, 2, 3]], dtype=torch.int32),
@@ -304,3 +310,4 @@ def test_code2wav_forward_finalizes_hift_tail():
assert out.shape == (1, 1, 8)
assert model.hift.finalize_calls == [True]
assert forward_mel_calls[0]["token_offset_tokens"] == 0