JarodMica / audiobook_maker

GNU General Public License v3.0
192 stars 33 forks source link

Audio Book Maker crashes when attempting to use with JarodMica/ai-voice-cloning fork #33

Closed mastachef closed 5 months ago

mastachef commented 5 months ago

This is the error the audio book maker outputs

C:\Users\Admin\Desktop\audiobook_maker_v1.1>.\runtime\python.exe .\audio_book_app_2_0.py
2024-01-29 23:15:24 | INFO | rvc.configs.config | Found GPU NVIDIA GeForce RTX 4070 Ti
[nltk_data] Downloading package punkt to ./assets...
[nltk_data]   Package punkt is already up-to-date!
[nltk_data] Downloading package punkt to ./assets...
[nltk_data]   Package punkt is already up-to-date!
Calling API with sentence: <Craigslist is not something I would use often.>
API response received with audio path: ./results//horror6//horror6_00026.wav
C:\Users\Admin\Desktop\audiobook_maker_v1.1\runtime\lib\site-packages\torch\_utils.py:776: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
  return self.fget.__get__(instance, owner)()
2024-01-29 23:16:01 | WARNING | rvc.infer.modules.vc.modules | Traceback (most recent call last):
  File "C:\Users\Admin\Desktop\audiobook_maker_v1.1\rvc\infer\lib\audio.py", line 54, in load_audio
    with open(file, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: './results//horror6//horror6_00026.wav'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Admin\Desktop\audiobook_maker_v1.1\rvc\infer\modules\vc\modules.py", line 171, in vc_single
    audio = load_audio(input_audio_path, 16000)
  File "C:\Users\Admin\Desktop\audiobook_maker_v1.1\rvc\infer\lib\audio.py", line 66, in load_audio
    raise RuntimeError(f"Failed to load audio: {e}")
RuntimeError: Failed to load audio: [Errno 2] No such file or directory: './results//horror6//horror6_00026.wav'

Traceback (most recent call last):
  File "C:\Users\Admin\Desktop\audiobook_maker_v1.1\audio_book_app_2_0.py", line 46, in run
    self.function(self.directory_path, self.report_progress)
  File "C:\Users\Admin\Desktop\audiobook_maker_v1.1\audio_book_app_2_0.py", line 752, in generate_audio_for_sentence_threaded
    audio_path = self.generate_audio(sentence)
  File "C:\Users\Admin\Desktop\audiobook_maker_v1.1\audio_book_app_2_0.py", line 796, in generate_audio
    audio_path = rvc_convert(model_path=voice_model_path,
  File "C:\Users\Admin\Desktop\audiobook_maker_v1.1\runtime\lib\site-packages\rvc_pipe\rvc_infer.py", line 124, in rvc_convert
    wavfile.write(output_file_path, tgt_sr, audio_opt)
  File "C:\Users\Admin\Desktop\audiobook_maker_v1.1\runtime\lib\site-packages\scipy\io\wavfile.py", line 772, in write
    dkind = data.dtype.kind
AttributeError: 'NoneType' object has no attribute 'dtype'

C:\Users\Admin\Desktop\audiobook_maker_v1.1>pause
Press any key to continue . . .

And heres the console for the ai-voice-cloning fork (which is working/generating text no issues)

Loaded TTS, ready for generation.
2024-01-29 23:14:45 | INFO | httpx | HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
2024-01-29 23:14:45 | INFO | httpx | HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
2024-01-29 23:14:45 | INFO | httpx | HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
2024-01-29 23:14:45 | INFO | httpx | HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
2024-01-29 23:14:46 | INFO | httpx | HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
2024-01-29 23:14:46 | INFO | httpx | HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
2024-01-29 23:14:48 | INFO | httpx | HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
2024-01-29 23:14:48 | INFO | httpx | HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 200 OK"
2024-01-29 23:14:48 | INFO | httpx | HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
2024-01-29 23:14:48 | INFO | httpx | HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
[1/1] Generating line: [I am really angry,] Craigslist is not something I would use often.
Loading voice: horror6 with model aca75205
Loading voice: horror6
Reading from latent: ./voices/horror6//cond_latents_aca75205.pth
{'temperature': 0.55, 'top_p': 0.8, 'diffusion_temperature': 0.55, 'length_penalty': 6.0, 'repetition_penalty': 8.0, 'cond_free_k': 2.0, 'num_autoregressive_samples': 16, 'sample_batch_size': 8, 'diffusion_iterations': 100, 'voice_samples': None, 'conditioning_latents': (tensor([[-0.2473,  6.3409,  1.7531,  ...,  2.4944,  1.3157,  0.2671]]), tensor([[-0.9745, -1.0212, -0.5711,  ..., -0.0341, -0.0327,  0.0937]])), 'use_deterministic_seed': None, 'return_deterministic_state': True, 'k': 1, 'diffusion_sampler': 'DDIM', 'breathing_room': 8, 'half_p': False, 'cond_free': False, 'cvvp_amount': 0, 'autoregressive_model': './training/horror6/finetune/models/200_gpt.pth', 'diffusion_model': './models/tortoise/diffusion_decoder.pth', 'tokenizer_json': './modules/tortoise-tts/tortoise/data/tokenizer.json'}
------------------------------------------------------
Free memory : 6.630859 (GigaBytes)
Total memory: 11.993530 (GigaBytes)
Requested memory: 3.375000 (GigaBytes)
Setting maximum total tokens (input + output) to 1024
------------------------------------------------------
Generating line took 13.012733936309814 seconds
C:\Users\Admin\Desktop\ai-voice-cloning\runtime\lib\site-packages\torchaudio\functional\functional.py:1371: UserWarning: "kaiser_window" resampling method name is being deprecated and replaced by "sinc_interp_kaiser" in the next release. The default behavior remains unchanged.
  warnings.warn(
Generation took 13.262595891952515 seconds, saved to './results//horror6//horror6_00026.wav
mastachef commented 5 months ago

Here is the error using the original mrq ai-voice-cloning fork

C:\Users\Admin\Desktop\audiobook_maker_v1.1>.\runtime\python.exe .\audio_book_app_2_0.py
2024-01-29 23:29:59 | INFO | rvc.configs.config | Found GPU NVIDIA GeForce RTX 4070 Ti
[nltk_data] Downloading package punkt to ./assets...
[nltk_data]   Package punkt is already up-to-date!
[nltk_data] Downloading package punkt to ./assets...
[nltk_data]   Package punkt is already up-to-date!
Calling API with sentence: <Craigslist is not something I would use often.>
An unexpected error occurred: 'data'
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7861, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7862, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7863, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7864, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7865, trying next port
Attempt 1 failed, retrying...
Calling API with sentence: <Craigslist is not something I would use often.>
An unexpected error occurred: 'data'
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7861, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7862, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7863, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7864, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7865, trying next port
Attempt 2 failed, retrying...
Calling API with sentence: <Craigslist is not something I would use often.>
An unexpected error occurred: 'data'
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7861, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7862, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7863, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7864, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7865, trying next port
Attempt 3 failed, retrying...
Calling API with sentence: <Craigslist is not something I would use often.>
An unexpected error occurred: 'data'
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7861, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7862, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7863, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7864, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7865, trying next port
Attempt 4 failed, retrying...
Calling API with sentence: <Craigslist is not something I would use often.>
An unexpected error occurred: 'data'
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7861, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7862, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7863, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7864, trying next port
Calling API with sentence: <Craigslist is not something I would use often.>
Failed to connect to port 7865, trying next port
Attempt 5 failed, retrying...
Failed to connect after 5 attempts
C:\Users\Admin\Desktop\audiobook_maker_v1.1\runtime\lib\site-packages\torch\_utils.py:776: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly.  To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
  return self.fget.__get__(instance, owner)()
Traceback (most recent call last):
  File "C:\Users\Admin\Desktop\audiobook_maker_v1.1\audio_book_app_2_0.py", line 46, in run
    self.function(self.directory_path, self.report_progress)
  File "C:\Users\Admin\Desktop\audiobook_maker_v1.1\audio_book_app_2_0.py", line 752, in generate_audio_for_sentence_threaded
    audio_path = self.generate_audio(sentence)
  File "C:\Users\Admin\Desktop\audiobook_maker_v1.1\audio_book_app_2_0.py", line 796, in generate_audio
    audio_path = rvc_convert(model_path=voice_model_path,
  File "C:\Users\Admin\Desktop\audiobook_maker_v1.1\runtime\lib\site-packages\rvc_pipe\rvc_infer.py", line 122, in rvc_convert
    _, (tgt_sr, audio_opt) = vc.vc_single(0, input_path, f0_up_key, None, f0method, file_index, file_index2, index_rate, filter_radius, resample_sr, rms_mix_rate, protect)
TypeError: cannot unpack non-iterable NoneType object

C:\Users\Admin\Desktop\audiobook_maker_v1.1>pause
Press any key to continue . . .

And the errors in console for the mrq ai-voice-cloning fork

[1/1] Generating line: [I am really angry,] Craigslist is not something I would use often.
Loading voice: horror6 with model d1f79232
Loading voice: horror6
Traceback (most recent call last):
  File "C:\Users\Admin\Desktop\tortoise\ai-voice-cloning\venv\lib\site-packages\gradio\routes.py", line 394, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Users\Admin\Desktop\tortoise\ai-voice-cloning\venv\lib\site-packages\gradio\blocks.py", line 1075, in process_api
    result = await self.call_function(
  File "C:\Users\Admin\Desktop\tortoise\ai-voice-cloning\venv\lib\site-packages\gradio\blocks.py", line 884, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\Admin\Desktop\tortoise\ai-voice-cloning\venv\lib\site-packages\anyio\to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "C:\Users\Admin\Desktop\tortoise\ai-voice-cloning\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 2134, in run_sync_in_worker_thread
    return await future
  File "C:\Users\Admin\Desktop\tortoise\ai-voice-cloning\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 851, in run
    result = context.run(func, *args)
  File "C:\Users\Admin\Desktop\tortoise\ai-voice-cloning\venv\lib\site-packages\gradio\helpers.py", line 587, in tracked_fn
    response = fn(*args)
  File "C:\Users\Admin\Desktop\tortoise\ai-voice-cloning\src\webui.py", line 94, in generate_proxy
    raise e
  File "C:\Users\Admin\Desktop\tortoise\ai-voice-cloning\src\webui.py", line 88, in generate_proxy
    sample, outputs, stats = generate(**kwargs)
  File "C:\Users\Admin\Desktop\tortoise\ai-voice-cloning\src\utils.py", line 363, in generate
    return generate_tortoise(**kwargs)
  File "C:\Users\Admin\Desktop\tortoise\ai-voice-cloning\src\utils.py", line 1222, in generate_tortoise
    settings = get_settings( override=override )
  File "C:\Users\Admin\Desktop\tortoise\ai-voice-cloning\src\utils.py", line 1084, in get_settings
    settings['voice_samples'], settings['conditioning_latents'], _ = fetch_voice(voice=selected_voice)
  File "C:\Users\Admin\Desktop\tortoise\ai-voice-cloning\src\utils.py", line 1017, in fetch_voice
    voice_samples, conditioning_latents = load_voice(voice, model_hash=tts.autoregressive_model_hash)
  File "C:\Users\Admin\Desktop\tortoise\ai-voice-cloning\modules\tortoise-tts\tortoise\utils\audio.py", line 164, in load_voice
    paths = voices[voice]
KeyError: 'horror6'
JarodMica commented 5 months ago

FileNotFoundError: [Errno 2] No such file or directory: './results//horror6//horror6_00026.wav'

Make sure you change the TTS results in the settings tab to an absolute path. It's a relative path right now which is the default for AVC out of the bag

mastachef commented 5 months ago

FileNotFoundError: [Errno 2] No such file or directory: './results//horror6//horror6_00026.wav'

Make sure you change the TTS results in the settings tab to an absolute path. It's a relative path right now which is the default for AVC out of the bag

thank you seems this fixed it