-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache folders not created when transcribing audio #181
Comments
Thanks for this, was trying to figure out why every model I tried was not working! |
Weird, folder creation occurs in procedure CreateProcessAudio, line 142 - " process_data.process_data_paths.processing_audio_path = CreateProcessAudio(process_data)", as defined in CreateProcessAudio - os_helper.create_folder(process_data.process_data_paths.cache_folder_path) , line (423). I wonder what is happening there. transcription_path is just a .json file in the cache_folder_path (transcription_path = os.path.join(cache_folder_path, f"{transcription_config}.json")) Was there any other error message prior? |
Can someone make an PR or give an song link? |
|
I am pretty sure I know what the problem is. Will create a PR. Issue is the "/" in the --whisper_align_model option/parameter. The "/" get's interpreted literally, confusing python about the cache path. |
Workaround, if you are in a hurry is to edit UltraSinger.py at line 466: def transcribe_audio(cache_folder_path: str, processing_audio_path: str) -> TranscriptionResult: Marked and highlighted are the changes: Essentially, we check if the argument for --whisper_align_model was provided, and if it was, we replace any "/" in the name with "_" in the cache folder path. That way, the setting remains valid for the model, but does not confuse the OS with a "/" in a pathname, making it interpret it as a folder and hence resulting in a file not found error. |
I use UltraSinger with a model to transcribe Swedish songs, specifically like this:
python UltraSinger.py -i 'some-swedish-song' --whisper_align_model 'KBLab/wav2vec2-large-voxrex-swedish'
It fails with a FileNotFoundError.
Traceback (most recent call last): File "/home/user/Dev/UltraSinger/src/UltraSinger.py", line 693, in <module> main(sys.argv[1:]) File "/home/user/Dev/UltraSinger/src/UltraSinger.py", line 573, in main run() File "/home/user/Dev/UltraSinger/src/UltraSinger.py", line 147, in run TranscribeAudio(process_data) File "/home/user/Dev/UltraSinger/src/UltraSinger.py", line 353, in TranscribeAudio transcription_result = transcribe_audio(process_data.process_data_paths.cache_folder_path, File "/home/user/Dev/UltraSinger/src/UltraSinger.py", line 483, in transcribe_audio with open(transcription_path, "w", encoding=FILE_ENCODING) as file: FileNotFoundError: [Errno 2] No such file or directory: '/home/user/Dev/UltraSinger/src/output/Kent - Ingen kunde röra oss/cache/whisper_large-v3_cuda_KBLab/wav2vec2-large-voxrex-swedish_KBLab/wav2vec2-large-voxrex-swedish_16_None_None.json'
I figured out that the folders were not created and open therefore failed. Adding this on line 483 fixes the issue:
os.makedirs(os.path.dirname(transcription_path), exist_ok=True)
The text was updated successfully, but these errors were encountered: