Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

KeyError: 'ja' when I use a Japanese wav file to finetune #15

Open
Sndragon88 opened this issue Dec 25, 2023 · 2 comments
Open

KeyError: 'ja' when I use a Japanese wav file to finetune #15

Sndragon88 opened this issue Dec 25, 2023 · 2 comments

Comments

@Sndragon88
Copy link

Sndragon88 commented Dec 25, 2023

My wav file is converted into mono, 22050Hz, 16bit pcm beforehand. I got this error log:


Existing language matches target language
Loading Whisper Model!
Discarding ID3 tags because more suitable tags were found.
Traceback (most recent call last):
File "D:\Long\AI\Audio\xtts-webui\xtts_finetune_webui.py", line 246, in preprocess_dataset
train_meta, eval_meta, audio_total_size = format_audio_list(audio_path, whisper_model = whisper_model, target_language=language, out_path=out_path, gradio_progress=progress)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Long\AI\Audio\xtts-webui\scripts\utils\formatter.py", line 160, in format_audio_list
sentence = multilingual_cleaners(sentence, target_language)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Long\AI\Audio\xtts-webui\venv\Lib\site-packages\TTS\tts\layers\xtts\tokenizer.py", line 558, in multilingual_cleaners
text = expand_numbers_multilingual(text, lang)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Long\AI\Audio\xtts-webui\venv\Lib\site-packages\TTS\tts\layers\xtts\tokenizer.py", line 538, in expand_numbers_multilingual
text = re.sub(_ordinal_re[lang], lambda m: _expand_ordinal(m, lang), text)
~~~~~~~~~~~^^^^^^
KeyError: 'ja'


I got the same error at local and Colab, so maybe something is wrong with Japanese settings?

@daswer123
Copy link
Owner

Hi this is a common problem with the TTS lib coqui-ai/TTS#3384 (comment) , but I was able to adapt it and now in my custom xtts_finetune_webui it is possible to train Japanese

image

finetune quality

jp_finetune.mp4

@Sndragon88
Copy link
Author

Sndragon88 commented Dec 26, 2023

Thanks, your new codes work. I got one finetune (with a few audio data) completed until the end inference test.

Afterwards, I made another finetune with more training data. This time it get past Epoch 5/6, then there's a PermissionError: [WinError 5] Access is denied . If I run the .bat file in administration, the cmd window will report a missing file in system32 and stops.
Maybe it's because the "Clear train data" option? I tried setting it to "None", but the same error occured.

Edit: I found that deleting the finetune_model/run folder and running step 2 again works. So this may happen when we make a second finetune and the program can’t delete a file in this folder.


Traceback (most recent call last):
File "D:\Long\AI\Audio\xtts-webui\venv\Lib\site-packages\gradio\queueing.py", line 459, in call_prediction
output = await route_utils.call_process_api(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Long\AI\Audio\xtts-webui\venv\Lib\site-packages\gradio\route_utils.py", line 232, in call_process_api
output = await app.get_blocks().process_api(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Long\AI\Audio\xtts-webui\venv\Lib\site-packages\gradio\blocks.py", line 1533, in process_api
result = await self.call_function(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Long\AI\Audio\xtts-webui\venv\Lib\site-packages\gradio\blocks.py", line 1151, in call_function
prediction = await anyio.to_thread.run_sync(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Long\AI\Audio\xtts-webui\venv\Lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Long\AI\Audio\xtts-webui\venv\Lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
^^^^^^^^^^^^
File "D:\Long\AI\Audio\xtts-webui\venv\Lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, *args)
^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Long\AI\Audio\xtts-webui\venv\Lib\site-packages\gradio\utils.py", line 678, in wrapper
response = f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "D:\Long\AI\Audio\xtts-webui\xtts_finetune_webui.py", line 339, in train_model
os.remove(run_dir)
PermissionError: [WinError 5] Access is denied: 'D:\Long\AI\Audio\xtts-webui\finetune_models\run'_

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants