(rank)
| 288 | return new_human_speech1, new_human_speech2, sum_human_speechs |
| 289 | |
| 290 | def _init_logging(rank): |
| 291 | # logging |
| 292 | if rank == 0: |
| 293 | # set format |
| 294 | logging.basicConfig( |
| 295 | level=logging.INFO, |
| 296 | format="[%(asctime)s] %(levelname)s: %(message)s", |
| 297 | handlers=[logging.StreamHandler(stream=sys.stdout)]) |
| 298 | else: |
| 299 | logging.basicConfig(level=logging.ERROR) |
| 300 | |
| 301 | def get_embedding(speech_array, wav2vec_feature_extractor, audio_encoder, sr=16000, device='cpu'): |
| 302 | audio_duration = len(speech_array) / sr |