(rank)
| 310 | return new_human_speech1, new_human_speech2, sum_human_speechs |
| 311 | |
| 312 | def _init_logging(rank): |
| 313 | # logging |
| 314 | if rank == 0: |
| 315 | # set format |
| 316 | logging.basicConfig( |
| 317 | level=logging.INFO, |
| 318 | format="[%(asctime)s] %(levelname)s: %(message)s", |
| 319 | handlers=[logging.StreamHandler(stream=sys.stdout)]) |
| 320 | else: |
| 321 | logging.basicConfig(level=logging.ERROR) |
| 322 | |
| 323 | def get_embedding(speech_array, wav2vec_feature_extractor, audio_encoder, sr=16000, device='cpu'): |
| 324 | audio_duration = len(speech_array) / sr |