(path: Path)
| 182 | ).eval().to(device) |
| 183 | |
| 184 | def load_request_audio(path: Path) -> torch.Tensor: |
| 185 | waveform = load_audio(str(resolve_repo_path(path)), sample_rate=model.config.sample_rate) |
| 186 | if args.max_audio_seconds > 0.0: |
| 187 | max_samples = int(round(args.max_audio_seconds * model.config.sample_rate)) |
| 188 | waveform = waveform[:max_samples] |
| 189 | if waveform.numel() == 0: |
| 190 | raise RuntimeError(f"MioCodec warmbench loaded empty audio: {path}") |
| 191 | return waveform.to(device) |
| 192 | |
| 193 | def run_vc_once(source_path: Path, target_path: Path) -> tuple[np.ndarray, int, float]: |
| 194 | source = load_request_audio(source_path) |
no test coverage detected