Skip to content

Commit 6fcfd6d

Browse files
committed
Normalize empty patch context lines
1 parent cbc2ded commit 6fcfd6d

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎evidence/minicpm-vllm-seedtts/patch/experimental-async-reference.patch‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@@ -721,6 +722,31 @@
1212
next_mel = torch.cat((old_mel[..., -(keep - chunk_mel.shape[2]) :], chunk_mel), dim=2)
1313
return speech, source, next_mel.detach()
14-
14+
1515
+ def prefetch_prompt_cpu(self, prompt_cache_id: str, prompt_wav: str, workers: int) -> bool:
1616
+ """Queue bounded CPU extraction; accelerator work stays on the caller."""
1717
+ if workers <= 0 or torch.get_default_dtype() != torch.float32:
@@ -99,15 +99,15 @@
9999
+ logger.exception("MiniCPM-o CPU reference prefetch failed for %s", state_id)
100100
+ self._drop_prefetch(state_id)
101101
+
102-
102+
103103
@torch.inference_mode()
104104
def run_idle_prefetch(self) -> bool:
105105
--- a/vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_token2wav.py
106106
+++ b/vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_token2wav.py
107107
@@ -119,9 +119,12 @@
108108
def speech_window(self) -> torch.Tensor:
109109
return self._core.speech_window
110-
110+
111111
- def _prepare_prompt(self, prompt_wav: str):
112112
+ def _prepare_prompt_cpu(self, prompt_wav: str):
113113
+ return self._core._prepare_prompt_cpu(prompt_wav)
@@ -116,23 +116,23 @@
116116
"""Delegate prompt feature extraction to the wrapped core."""
117117
- return self._core._prepare_prompt(prompt_wav)
118118
+ return self._core._prepare_prompt(prompt_wav, cpu_features=cpu_features)
119-
119+
120120
def enable_trt_spk_embedding(self, *, cpu_reference: bool = False) -> None:
121121
"""Run the campplus speaker-embedding model on TensorRT."""
122122
--- a/vllm_omni/model_executor/models/step_audio2/step_audio2_token2wav.py
123123
+++ b/vllm_omni/model_executor/models/step_audio2/step_audio2_token2wav.py
124124
@@ -514,8 +514,9 @@
125125
)
126126
return code, code_len
127-
127+
128128
- def _prepare_prompt(self, prompt_wav: str):
129129
- """Prepare prompt audio for conditioning"""
130130
+ @staticmethod
131131
+ def _prepare_prompt_cpu(prompt_wav: str):
132132
+ """Extract reference features without accessing the accelerator."""
133133
audio_np_raw, sample_rate = load_audio(prompt_wav, sr=None, mono=True)
134134
sample_rate = int(sample_rate)
135-
135+
136136
@@ -524,29 +525,8 @@
137137
audio = torch.from_numpy(audio_16k)
138138
mels = s3tokenizer.log_mel_spectrogram(audio)

‎evidence/minicpm-vllm-seedtts/patch/experimental-validated-sample.patch‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
+ token = scores.argmax(dim=-1)
5656
sampled.append(token)
5757
return self.advance(torch.cat(sampled), frame, eos_token_id)
58-
58+
5959
--- a/vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_code2wav.py
6060
+++ b/vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_code2wav.py
6161
@@ -1690,7 +1690,12 @@
@@ -69,6 +69,6 @@
6969
+ logger.info("[RSI prefetch treatment] executed with %d waiting references", queued_before)
7070
+ self._rsi_multiqueue_prefetch_logged = True
7171
+ return ran
72-
72+
7373
def _run_prefetch_phase(self, state_id: str, record: _RefPrefetch) -> bool:
7474
"""Run the next phase of ``record``; see ``run_idle_prefetch``."""

0 commit comments

Comments
 (0)