ebook2audiobook: MacOS - Safari session issue, high memory consumption (on local run), low docker performance

This is just a rudimentary guide, don’t be too intimidated, You don’t have to follow this to the tee BEFORE TO OPEN AN ISSUE, MAKE SURE THAT IT HASN’T ALREADY BEEN SOLVED OR REPORTED. 😃 Check it with the issue search field

Script Mode

  • Native & Docker

Process Mode

  • Gradio GUI

Command Line (headless mode only)

  • provide the exact command line

Operating System:

  • MacOS

Describe the bug I have tried running it both in docker and locally. Platform: M4 pro 24 GB RAM Book: George Orwell - Animal Farm epub Language: ENG -> Hungarian Processor Unit: MPS Every other setting left on default.

In docker, it used about 8% CPU (total) | 1 core, and below 4 GB of memory. Left it running for 30 minutes, but it only did a few percents, so I stopped the container. Pressing x did not stop container CPU and memory utilization.

I’m currently testing it locally. Finished 5% in 750 seconds. The process: python3.12 is using ~150% CPU, above 32 GB of memory. In Safari, the session seems bugged. Bottom progress bar disappeared and Error appeared. The loading animation appeared in the file box and it’s counting the seconds there. After refreshing the page, the “Select a file” box is back to normal, however bottom progress bar didn’t resume

My other containers are using ~11 GB, so it’s swapping heavily. Memory pressure almost always in the yellow. Swap used is ~20 GB.

Terminal log

Update: Docker attempt nr2 with a shorter epub:

Image

/home/user/.local/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']}):
IPs available for connection:
['127.0.0.1', '::1', '192.168.216.2']
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()`.
Processing eBook file: Tablo_Publishing-Reviewing_E-Sports_in_2021-2021.epub
Available Processor Unit: cpu
Running command: /usr/bin/ebook-convert /home/user/app/tmp/ebook-096b1a5c-652b-4f62-90fb-24023c85ba5d/15f13fba1764e5acd41f69d755678fed/Tablo_Publishing-Reviewing_E-Sports_in_2021-2021.epub /home/user/app/tmp/ebook-096b1a5c-652b-4f62-90fb-24023c85ba5d/15f13fba1764e5acd41f69d755678fed/__Tablo_Publishing-Reviewing_E-Sports_in_2021-2021.epub --input-encoding=utf-8 --output-profile=generic_eink --verbose
Conversion options changed from defaults:
  output_profile: 'generic_eink'
  input_encoding: 'utf-8'
  verbose: 1
1% Converting input to HTML...
InputFormatPlugin: EPUB Input running
on /home/user/app/tmp/ebook-096b1a5c-652b-4f62-90fb-24023c85ba5d/15f13fba1764e5acd41f69d755678fed/Tablo_Publishing-Reviewing_E-Sports_in_2021-2021.epub
Parsing all content...
Parsing OEBPS/46ade8f8-29e3-475f-a0ee-0e2b6748222f.xhtml ...
Parsing OEBPS/nav.xhtml ...
Parsing OEBPS/styles.css ...
Reading TOC from NCX...
34% Running transforms on e-book...
Merging user specified metadata...
Detecting structure...
	Detected chapter: Chapter 1
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Found 22 items of level: p_1
Ignoring level p_1
Cleaning up manifest...
Trimming unused files from manifest...
Trimming 'OEBPS/nav.xhtml' from manifest
Trimming 'OEBPS/toc.ncx' 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 OEBPS/46ade8f8-29e3-475f-a0ee-0e2b6748222f.xhtml...
	No large trees found
Generating default cover
EPUB output written to /home/user/app/tmp/ebook-096b1a5c-652b-4f62-90fb-24023c85ba5d/15f13fba1764e5acd41f69d755678fed/__Tablo_Publishing-Reviewing_E-Sports_in_2021-2021.epub
Output saved to   /home/user/app/tmp/ebook-096b1a5c-652b-4f62-90fb-24023c85ba5d/15f13fba1764e5acd41f69d755678fed/__Tablo_Publishing-Reviewing_E-Sports_in_2021-2021.epub
******* NOTE: YOU CAN SAFELY IGNORE "Character xx not found in the vocabulary." *******
Loading TTS tts_models/multilingual/multi-dataset/xtts_v2 model, it takes a while, please be patient...

convertsion 0.00%: 0/34 [W304 16:31:08.486213999 NNPACK.cpp:62] Could not initialize NNPACK! Reason: Unsupported hardware.

After getting stuck, the hardware utilization persists

Image

Update2:

Using local run, I copied the session id to Firefox while converting is in progress. In both instances the bottom progress bar doesn’t show the status

Image

About this issue

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

Most upvoted comments

…perhaps at that point its best to just like… idk run it locally, cause docker is already so slow especially with only cpu…

possibly not for long: https://www.docker.com/blog/introducing-docker-model-runner/

oh yeah forgot to mention the latest docker image has a ARM version now so anyone running this on ARM should delete the x86 docker image so then docker will pull the ARM version instead

Update: Universal arm dockerfile created successfully,

Will be merged into main soon,

Details: https://github.com/DrewThomasson/ebook2audiobook/pull/422