(rank)
| 278 | return new_human_speech1, new_human_speech2, sum_human_speechs |
| 279 | |
| 280 | def _init_logging(rank): |
| 281 | # logging |
| 282 | if rank == 0: |
| 283 | # set format |
| 284 | logging.basicConfig( |
| 285 | level=logging.INFO, |
| 286 | format="[%(asctime)s] %(levelname)s: %(message)s", |
| 287 | handlers=[logging.StreamHandler(stream=sys.stdout)]) |
| 288 | else: |
| 289 | logging.basicConfig(level=logging.ERROR) |
| 290 | |
| 291 | def get_embedding(speech_array, wav2vec_feature_extractor, audio_encoder, sr=16000, device='cpu'): |
| 292 | audio_duration = len(speech_array) / sr |