JarodMica / audiobook_maker

GNU General Public License v3.0
293 stars 47 forks source link

96% of the way through a 24 hour generation and I am hit with a Too much text error. How do I break up the line without starting over? #68

Open couchpotatochip21 opened 1 week ago

couchpotatochip21 commented 1 week ago

I was doing a 700 page textbook when I discovered an error at 96% completion stating the following: RuntimeError: Possible latent mismatch: try recomputing voice latents. Error: Too much text provided. Break the text up into separate segments and re-try inference.

Now this line is fairly long but I can't seem to find any way to just skip this line or break up this line. Is there any way for me to save this?

couchpotatochip21 commented 1 week ago

I found a fix, go to the folder for the Audiobook Maker and go to audiobooks > (youraudiobooknamefolder) > text_audio_map.json. Then, find the line that is too long (look for largest number .wav and it will lead you to where the failed line should be) and shorten it. I have not tested how this affects the audio but the script has continued.

JarodMica commented 1 week ago

Ooh yeah, this is an issue with tortoise and I may need to handle it better with my segmeneter and tortoise. For now, your fix will work.

Also, 700 pages, that's wild! Glad to hear it's being used to good use

couchpotatochip21 commented 1 week ago

Ooh yeah, this is an issue with tortoise and I may need to handle it better with my segmeneter and tortoise. For now, your fix will work.

Also, 700 pages, that's wild! Glad to hear it's being used to good use

Thank you so much for the reply!

Unfortunately the export failed, something about segment length? I will reply in a bit with the error as I will try it again. Do I need to modify the segment length to fit the new sentence or something? I cut the segment that was too long in half so it may have problems with the audio clip length.

couchpotatochip21 commented 1 week ago

C:\Users\_\Documents\audobookmaker\audiobook_maker>call venv\Scripts\activate [2024-10-30 05:13:45,184] [INFO] [real_accelerator.py:203:get_accelerator] Setting ds_accelerator to cuda (auto detect) W1030 05:13:54.908000 23832 torch\distributed\elastic\multiprocessing\redirects.py:27] NOTE: Redirects are currently not supported in Windows or MacOs. Traceback (most recent call last): File "C:\Users\_\Documents\audobookmaker\audiobook_maker\src\controller.py", line 793, in export_audiobook output_filename = self.model.export_audiobook(directory_path, pause_duration) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\_\Documents\audobookmaker\audiobook_maker\src\model.py", line 368, in export_audiobook combined_audio.export(output_filename, format="mp3") File "C:\Users\_\Documents\audobookmaker\audiobook_maker\venv\Lib\site-packages\pydub\audio_segment.py", line 895, in export wave_data.writeframesraw(pcm_for_wav) File "C:\Users\_\AppData\Local\Programs\Python\Python311\Lib\wave.py", line 547, in writeframesraw self._ensure_header_written(len(data)) File "C:\Users\_\AppData\Local\Programs\Python\Python311\Lib\wave.py", line 588, in _ensure_header_written self._write_header(datasize) File "C:\Users\_\AppData\Local\Programs\Python\Python311\Lib\wave.py", line 600, in _write_header self._file.write(struct.pack('<L4s4sLHHLLHH4s', ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ struct.error: argument out of range

Swapped out my user for _ in this sippet.