diff --git a/long_audio_transcribe.py b/long_audio_transcribe.py index 92b2731..2af7832 100644 --- a/long_audio_transcribe.py +++ b/long_audio_transcribe.py @@ -61,7 +61,9 @@ if __name__ == "__main__": # trimmed_wav_seg = librosa.effects.trim(wav_seg.squeeze().numpy()) # trimmed_wav_seg = torch.tensor(trimmed_wav_seg[0]).unsqueeze(0) torchaudio.save(savepth, wav_seg, 22050, channels_first=True) - + if len(speaker_annos) == 0: + print("Warning: no long audios & videos found, this IS expected if you have only uploaded short audios") + print("this IS NOT expected if you have uploaded any long audios, videos or video links. Please check your file structure or make sure your audio/video language is supported.") with open("long_character_anno.txt", 'w', encoding='utf-8') as f: for line in speaker_annos: f.write(line) diff --git a/preprocess_v2.py b/preprocess_v2.py index 54cd4c4..5619049 100644 --- a/preprocess_v2.py +++ b/preprocess_v2.py @@ -24,7 +24,7 @@ if __name__ == "__main__": path, speaker, text = line.split("|") if speaker not in speakers: speakers.append(speaker) - assert (len(speakers) != 0), "no speaker found" + assert (len(speakers) != 0), "No audio file found. Please check your uploaded file structure." # Source 3 (Optional): sampled audios as extra training helpers if args.add_auxiliary_data: with open("sampled_audio4ft.txt", 'r', encoding='utf-8') as f: diff --git a/short_audio_transcribe.py b/short_audio_transcribe.py index 9cd851d..8a460de 100644 --- a/short_audio_transcribe.py +++ b/short_audio_transcribe.py @@ -87,6 +87,9 @@ if __name__ == "__main__": # cleaned_text += "\n" if not cleaned_text.endswith("\n") else "" # speaker_annos[i] = path + "|" + sid + "|" + cleaned_text # write into annotation + if len(speaker_annos) == 0: + print("Warning: no short audios found, this IS expected if you have only uploaded long audios, videos or video links.") + print("this IS NOT expected if you have uploaded a zip file of short audios. Please check your file structure or make sure your audio language is supported.") with open("short_character_anno.txt", 'w', encoding='utf-8') as f: for line in speaker_annos: f.write(line)