DrewThomasson / ebook2audiobook

Generates an audiobook with chapters and ebook metadata using Calibre and Xtts from Coqui tts, and with optional voice cloning, and supports multiple languages
MIT License
795 stars 78 forks source link

Docker WebUI want start #13

Closed matthiss closed 1 month ago

matthiss commented 1 month ago

OS: Fedora Linux 40 (Workstation Edition) x86_64 Kernel: 6.10.7-200.fc40.x86_64 CPU: AMD Ryzen 9 5900X (24) @ 3.700GHz GPU: NVIDIA GeForce RTX 3090 Memory: 96457MiB

Docker WebUI want start

If I execute docker run -it --rm --gpus all -p 7860:7860 athomasson2/ebook2audiobookxtts:latest the Webui won't start. I simply drop to a root shell on the container, diplaying the following:

==========
== CUDA ==
==========

CUDA Version 11.8.0

Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license

A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.

If I then try to manually start the webui, the installation seems broken

root@42368a76209a:/ebook2audiobookXTTS# python custom_model_ebook2audiobookXTTS_gradio.py
starting...
Traceback (most recent call last):
  File "/ebook2audiobookXTTS/custom_model_ebook2audiobookXTTS_gradio.py", line 7, in <module>
    from pydub import AudioSegment
ModuleNotFoundError: No module named 'pydub'

Can't build container from Dockerfile

If I try to build the container myself using the Dockerfile it looks like scapy can't compile. Could be related to this (already closed) issue https://github.com/explosion/spaCy/issues/13449.

597.0   Downloading spacy-3.0.6.tar.gz (7.1 MB)
599.8      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.1/7.1 MB 2.5 MB/s eta 0:00:00
600.2   Installing build dependencies: started
607.1   Installing build dependencies: finished with status 'done'
607.1   Getting requirements to build wheel: started
608.2   Getting requirements to build wheel: finished with status 'error'
608.2   error: subprocess-exited-with-error
608.2   
608.2   × Getting requirements to build wheel did not run successfully.
608.2   │ exit code: 1
608.2   ╰─> [164 lines of output]
608.2       
608.2       Error compiling Cython file:
608.2       ------------------------------------------------------------
608.2       ...
608.2           int length
608.2       
608.2       
608.2       cdef class Vocab:
608.2           cdef Pool mem
608.2           cpdef readonly StringStore strings
608.2                 ^
608.2       ------------------------------------------------------------
608.2       
608.2       spacy/vocab.pxd:28:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
608.2       
608.2       Error compiling Cython file:
608.2       ------------------------------------------------------------
608.2       ...
608.2       
608.2       
608.2       cdef class Vocab:
608.2           cdef Pool mem
608.2           cpdef readonly StringStore strings
608.2           cpdef public Morphology morphology
608.2                 ^
608.2       ------------------------------------------------------------
608.2       
608.2       spacy/vocab.pxd:29:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
608.2       
608.2       Error compiling Cython file:
608.2       ------------------------------------------------------------
608.2       ...
608.2       
608.2       cdef class Vocab:
608.2           cdef Pool mem
608.2           cpdef readonly StringStore strings
608.2           cpdef public Morphology morphology
608.2           cpdef public object vectors
608.2                 ^
608.2       ------------------------------------------------------------
608.2       
608.2       spacy/vocab.pxd:30:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
608.2       
608.2       Error compiling Cython file:
608.2       ------------------------------------------------------------
608.2       ...
608.2       cdef class Vocab:
608.2           cdef Pool mem
608.2           cpdef readonly StringStore strings
608.2           cpdef public Morphology morphology
608.2           cpdef public object vectors
608.2           cpdef public object _lookups
608.2                 ^
608.2       ------------------------------------------------------------
608.2       
608.2       spacy/vocab.pxd:31:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
608.2       
608.2       Error compiling Cython file:
608.2       ------------------------------------------------------------
608.2       ...
608.2           cdef Pool mem
608.2           cpdef readonly StringStore strings
608.2           cpdef public Morphology morphology
608.2           cpdef public object vectors
608.2           cpdef public object _lookups
608.2           cpdef public object writing_system
608.2                 ^
608.2       ------------------------------------------------------------
608.2       
608.2       spacy/vocab.pxd:32:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
608.2       
608.2       Error compiling Cython file:
608.2       ------------------------------------------------------------
608.2       ...
608.2           cpdef readonly StringStore strings
608.2           cpdef public Morphology morphology
608.2           cpdef public object vectors
608.2           cpdef public object _lookups
608.2           cpdef public object writing_system
608.2           cpdef public object get_noun_chunks
608.2                 ^
608.2       ------------------------------------------------------------
608.2       
608.2       spacy/vocab.pxd:33:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
608.2       
608.2       Error compiling Cython file:
608.2       ------------------------------------------------------------
608.2       ...
608.2           cdef float prior_prob
608.2       
608.2       
608.2       cdef class KnowledgeBase:
608.2           cdef Pool mem
608.2           cpdef readonly Vocab vocab
608.2                 ^
608.2       ------------------------------------------------------------
608.2       
608.2       spacy/kb.pxd:31:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
608.2       Copied /tmp/pip-install-s1yoqgkp/spacy_a3a04683ec794ce8805d0f2ae47f9987/setup.cfg -> /tmp/pip-install-s1yoqgkp/spacy_a3a04683ec794ce8805d0f2ae47f9987/spacy/tests/package
608.2       Copied /tmp/pip-install-s1yoqgkp/spacy_a3a04683ec794ce8805d0f2ae47f9987/pyproject.toml -> /tmp/pip-install-s1yoqgkp/spacy_a3a04683ec794ce8805d0f2ae47f9987/spacy/tests/package
608.2       Cythonizing sources
608.2       Compiling spacy/training/example.pyx because it changed.
608.2       Compiling spacy/parts_of_speech.pyx because it changed.
608.2       Compiling spacy/strings.pyx because it changed.
608.2       Compiling spacy/lexeme.pyx because it changed.
608.2       Compiling spacy/vocab.pyx because it changed.
608.2       Compiling spacy/attrs.pyx because it changed.
608.2       Compiling spacy/kb.pyx because it changed.
608.2       Compiling spacy/ml/parser_model.pyx because it changed.
608.2       Compiling spacy/morphology.pyx because it changed.
608.2       Compiling spacy/pipeline/dep_parser.pyx because it changed.
608.2       Compiling spacy/pipeline/morphologizer.pyx because it changed.
608.2       Compiling spacy/pipeline/multitask.pyx because it changed.
608.2       Compiling spacy/pipeline/ner.pyx because it changed.
608.2       Compiling spacy/pipeline/pipe.pyx because it changed.
608.2       Compiling spacy/pipeline/trainable_pipe.pyx because it changed.
608.2       Compiling spacy/pipeline/sentencizer.pyx because it changed.
608.2       Compiling spacy/pipeline/senter.pyx because it changed.
608.2       Compiling spacy/pipeline/tagger.pyx because it changed.
608.2       Compiling spacy/pipeline/transition_parser.pyx because it changed.
608.2       Compiling spacy/pipeline/_parser_internals/arc_eager.pyx because it changed.
608.2       Compiling spacy/pipeline/_parser_internals/ner.pyx because it changed.
608.2       Compiling spacy/pipeline/_parser_internals/nonproj.pyx because it changed.
608.2       Compiling spacy/pipeline/_parser_internals/_state.pyx because it changed.
608.2       Compiling spacy/pipeline/_parser_internals/stateclass.pyx because it changed.
608.2       Compiling spacy/pipeline/_parser_internals/transition_system.pyx because it changed.
608.2       Compiling spacy/pipeline/_parser_internals/_beam_utils.pyx because it changed.
608.2       Compiling spacy/tokenizer.pyx because it changed.
608.2       Compiling spacy/training/align.pyx because it changed.
608.2       Compiling spacy/training/gold_io.pyx because it changed.
608.2       Compiling spacy/tokens/doc.pyx because it changed.
608.2       Compiling spacy/tokens/span.pyx because it changed.
608.2       Compiling spacy/tokens/token.pyx because it changed.
608.2       Compiling spacy/tokens/span_group.pyx because it changed.
608.2       Compiling spacy/tokens/graph.pyx because it changed.
608.2       Compiling spacy/tokens/morphanalysis.pyx because it changed.
608.2       Compiling spacy/tokens/_retokenize.pyx because it changed.
608.2       Compiling spacy/matcher/matcher.pyx because it changed.
608.2       Compiling spacy/matcher/phrasematcher.pyx because it changed.
608.2       Compiling spacy/matcher/dependencymatcher.pyx because it changed.
608.2       Compiling spacy/symbols.pyx because it changed.
608.2       Compiling spacy/vectors.pyx because it changed.
608.2       [ 1/41] Cythonizing spacy/attrs.pyx
608.2       [ 2/41] Cythonizing spacy/kb.pyx
608.2       Traceback (most recent call last):
608.2         File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
608.2           main()
608.2         File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
608.2           json_out['return_val'] = hook(**hook_input['kwargs'])
608.2         File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
608.2           return hook(config_settings)
608.2         File "/tmp/pip-build-env-sbvqvvd7/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel
608.2           return self._get_build_requires(config_settings, requirements=[])
608.2         File "/tmp/pip-build-env-sbvqvvd7/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 302, in _get_build_requires
608.2           self.run_setup()
608.2         File "/tmp/pip-build-env-sbvqvvd7/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 318, in run_setup
608.2           exec(code, locals())
608.2         File "<string>", line 224, in <module>
608.2         File "<string>", line 211, in setup_package
608.2         File "/tmp/pip-build-env-sbvqvvd7/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
608.2           cythonize_one(*args)
608.2         File "/tmp/pip-build-env-sbvqvvd7/overlay/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
608.2           raise CompileError(None, pyx_file)
608.2       Cython.Compiler.Errors.CompileError: spacy/kb.pyx
608.2       [end of output]
608.2   
608.2   note: This error originates from a subprocess, and is likely not a problem with pip.
608.2 error: subprocess-exited-with-error
608.2 
608.2 × Getting requirements to build wheel did not run successfully.
608.2 │ exit code: 1
608.2 ╰─> See above for output.
608.2 
608.2 note: This error originates from a subprocess, and is likely not a problem with pip.
------
Dockerfile:30
--------------------
  28 |     # Install Python dependencies
  29 |     RUN pip install --upgrade pip
  30 | >>> RUN pip install bs4 pydub nltk beautifulsoup4 ebooklib tqdm mecab-python3 tts==0.21.3
  31 |     
  32 |     # Download unidic
--------------------
ERROR: failed to solve: process "/bin/sh -c pip install bs4 pydub nltk beautifulsoup4 ebooklib tqdm mecab-python3 tts==0.21.3" did not complete successfully: exit code: 1
DrewThomasson commented 1 month ago

Interesting....

Try running this docker?

It's the docker of this space tbh, but it's up and running so we know it works at least

HUGGINGFACE SPACE

docker run -it -p 7860:7860 --platform=linux/amd64 registry.hf.space/drewthomasson-ebook2audiobookxtts:latest python app.py
DrewThomasson commented 1 month ago

I'll see about updating the docker file in the readme, To make it more inline with this one

Docker hub-page

DrewThomasson commented 1 month ago

Just modified the dockerfile with the GPU one instead from the Docker hub page

-Honestly probs just easier to try one of the prebuilt ones,

With the Huggingface space you can still look at all the files like the requirements.txt packages.txt and the app.py inside of it