(
processor: MossTTSDelayProcessor,
paths: List[str],
batch_size: int,
n_vq: Optional[int],
desc: str,
)
| 97 | |
| 98 | |
| 99 | def batch_encode( |
| 100 | processor: MossTTSDelayProcessor, |
| 101 | paths: List[str], |
| 102 | batch_size: int, |
| 103 | n_vq: Optional[int], |
| 104 | desc: str, |
| 105 | ) -> List[torch.Tensor]: |
| 106 | all_codes: List[torch.Tensor] = [] |
| 107 | for start in tqdm(range(0, len(paths), batch_size), desc=desc): |
| 108 | batch_paths = paths[start : start + batch_size] |
| 109 | all_codes.extend(processor.encode_audios_from_path(batch_paths, n_vq=n_vq)) |
| 110 | return all_codes |
| 111 | |
| 112 | |
| 113 | def collect_paths(records: List[Dict[str, Any]], field_name: str) -> List[str]: |
no test coverage detected