| 228 | |
| 229 | |
| 230 | def extract_audio(outputs: Any, index: int = 0) -> np.ndarray: |
| 231 | speech_outputs = getattr(outputs, "speech_outputs", None) |
| 232 | if not speech_outputs or index >= len(speech_outputs) or speech_outputs[index] is None: |
| 233 | raise RuntimeError("VibeVoice warmbench received no speech output") |
| 234 | audio = speech_outputs[index] |
| 235 | if torch.is_tensor(audio): |
| 236 | audio = audio.detach().cpu().float().numpy() |
| 237 | return np.asarray(audio, dtype=np.float32).reshape(-1) |
| 238 | |
| 239 | |
| 240 | def patch_transformers_cache_signature(model: Any) -> None: |