ebook2audiobook: AttributeError: 'NoneType' object has no attribute 'get_conditioning_latents'

Summary:

When converting an example text file using a custom model the conversion is immediately “cancelled”. Terminal outputs the following error: AttributeError: ‘NoneType’ object has no attribute ‘get_conditioning_latents’. This is the same error seen in DrewThomasson/ebook2audiobook#278 but was noted as fixed. Still seeing this issue so making a dedicated issue for it. Please ignore if addressed already, but wanted to create an issue because I am still seeing this after pulling. Using WSL for this test.

Setup: Run git pull

alexanderacuna@alex-desktop:/mnt/c/Users/Alexander/ebook2audiobook$ git pull
remote: Enumerating objects: 61, done.
remote: Counting objects: 100% (61/61), done.
remote: Compressing objects: 100% (48/48), done.
remote: Total 61 (delta 33), reused 27 (delta 13), pack-reused 0 (from 0)
Unpacking objects: 100% (61/61), 15.42 KiB | 47.00 KiB/s, done.
From https://github.com/DrewThomasson/ebook2audiobook
   e60ca88..ef9e69a  main                 -> origin/main
 * [new branch]      Selenium_GUI_testing -> origin/Selenium_GUI_testing
Updating e60ca88..ef9e69a
Fast-forward
 ebook2audiobook.cmd        | 67 ++++++++++++++++++++++++++++++-------------------------------------
 lib/classes/tts_manager.py | 14 +++++++-------
 lib/functions.py           | 18 +++++++++++++-----
 3 files changed, 50 insertions(+), 49 deletions(-)

Steps to reproduce:

  1. Run script ‘ebook2audiobook.sh’ & wait for webui.
  2. Webui loads.
  3. Upload custom_model.zip. —> SUCCEEDS
  4. Select “custom_model” from dropdown.
  5. Upload test.txt file. —> SUCCEEDS
  6. Click the bottom ebook emojii to start conversion.
  7. Almost immediately the conversion is ‘cancelled’ via a notification in the webui.

Terminal output:

alexanderacuna@alex-desktop:/mnt/c/Users/Alexander/ebook2audiobook$ ./ebook2audiobook.sh
Running in native mode
IPs available for connection:
['127.0.0.1', '::1', '172.25.97.126', 'fe80::215:5dff:feaa:2754%eth0']
Note: 0.0.0.0 is not the IP to connect. Instead use an IP above to connect.
* Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.

Extracted files to /mnt/c/Users/Alexander/ebook2audiobook/models/__sessions/model-33b824f6-1a98-4f0d-bb39-cbaf746f7987/xtts/custom_model
Processing eBook file: test.txt
Available Processor Unit: cuda
Running command: /usr/bin/ebook-convert /mnt/c/Users/Alexander/ebook2audiobook/tmp/ebook-33b824f6-1a98-4f0d-bb39-cbaf746f7987/749f0afd72f75c2f83bbfab0b79f545b/test.txt /mnt/c/Users/Alexander/ebook2audiobook/tmp/ebook-33b824f6-1a98-4f0d-bb39-cbaf746f7987/749f0afd72f75c2f83bbfab0b79f545b/__test.epub --input-encoding=utf-8 --output-profile=generic_eink --verbose
Conversion options changed from defaults:
  output_profile: 'generic_eink'
  verbose: 1
  input_encoding: 'utf-8'
1% Converting input to HTML...
InputFormatPlugin: TXT Input running
on /mnt/c/Users/Alexander/ebook2audiobook/tmp/ebook-33b824f6-1a98-4f0d-bb39-cbaf746f7987/749f0afd72f75c2f83bbfab0b79f545b/test.txt
Reading text from file...
Using user specified input encoding of utf-8
Auto detected paragraph type as single
Auto detected formatting as heuristic
Running text through basic conversion...
Language not specified
Creator not specified
Building file list...
        Found files...
                 HTMLFile:0:a:'/mnt/c/Users/Alexander/ebook2audiobook/tmp/calibre_7.6.0_tmp_0ub5epf_/hzupxxyn_plumber/index.html'
Normalizing filename cases
Rewriting HTML links
Parsing index.html ...
*********  Heuristic processing HTML  *********
flow is too short, not running heuristics
Forcing index.html into XHTML namespace
34% Running transforms on e-book...
Merging user specified metadata...
Detecting structure...
Auto generated TOC with 0 entries.
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Found 1 items of level: p_1
Ignoring level p_1
Cleaning up manifest...
Trimming unused files from manifest...
Creating EPUB Output...
67% Running EPUB Output plugin
Splitting markup on page breaks and flow limits, if any...
        Looking for large trees in index.html...
        No large trees found
Generating default cover
This EPUB file has no Table of Contents. Creating a default TOC
EPUB output written to /mnt/c/Users/Alexander/ebook2audiobook/tmp/ebook-33b824f6-1a98-4f0d-bb39-cbaf746f7987/749f0afd72f75c2f83bbfab0b79f545b/__test.epub
Output saved to   /mnt/c/Users/Alexander/ebook2audiobook/tmp/ebook-33b824f6-1a98-4f0d-bb39-cbaf746f7987/749f0afd72f75c2f83bbfab0b79f545b/__test.epub

/mnt/c/Users/Alexander/ebook2audiobook/python_env/lib/python3.12/site-packages/ebooklib/epub.py:1423: FutureWarning: This search incorrectly ignores the root element, and will be fixed in a future version.  If you rely on the current behaviour, change it to './/xmlns:rootfile[@media-type]'
  for root_file in tree.findall('//xmlns:rootfile[@media-type]', namespaces={'xmlns': NAMESPACES['CONTAINERNS']}):
******* NOTE: YOU CAN SAFELY IGNORE "Character xx not found in the vocabulary." *******
Loading TTS xtts model from /mnt/c/Users/Alexander/ebook2audiobook/models/__sessions/model-33b824f6-1a98-4f0d-bb39-cbaf746f7987/xtts/custom_model, it takes a while, please be patient...
coqui_tts_load_custom() error: Xtts.load_checkpoint() got an unexpected keyword argument 'enable_deepspeed'
convertsion 0.00%: 0/1 Part 1 containing 1 sentences...
Computing speaker latents...
convertsion 0.00%: 0/1
'NoneType' object has no attribute 'get_conditioning_latents'
Traceback (most recent call last):
  File "/mnt/c/Users/Alexander/ebook2audiobook/lib/classes/tts_manager.py", line 167, in convert_sentence_to_audio
    self.params['gpt_cond_latent'], self.params['speaker_embedding'] = self.params['tts'].get_conditioning_latents(audio_path=[self.params['voice_path']])
                                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_conditioning_latents'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/c/Users/Alexander/ebook2audiobook/lib/functions.py", line 675, in convert_chapters_to_audio
    if tts_manager.convert_sentence_to_audio():
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/Users/Alexander/ebook2audiobook/lib/classes/tts_manager.py", line 286, in convert_sentence_to_audio
    raise ValueError(e)
ValueError: 'NoneType' object has no attribute 'get_conditioning_latents'
Caught DependencyError: 'NoneType' object has no attribute 'get_conditioning_latents'
convert_chapters_to_audio() failed!

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 53 (2 by maintainers)

Commits related to this issue

Most upvoted comments

ok I see, it’s missing the tts_engine folder in the path, I’m fixing it now.

Holy smokes it worked. Also looks like it is using my GPU. Nice.

Image

ok works for me thanks

ok fixed!.

request access… nevermind I succeeded to reproduce it… I’m working on it.

the last model.zip you used

@macramores ok thanks my fix is not working. next PR will be solved tonight

ah ok, sorry, it’s eb2ab, it should delete only if it’s in GUI mode, not headless. I fix it with the other fix.

ok merged. it should work now. git pull…

please do it in headless mode, logs are more explicit