Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added fine tuned models in conf.py, renamed some #99

Merged
merged 3 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
194 changes: 97 additions & 97 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,97 +1,97 @@
# Use an official NVIDIA CUDA image with cudnn8 and Ubuntu 20.04 as the base
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04

# Set non-interactive installation to avoid timezone and other prompts
ENV DEBIAN_FRONTEND=noninteractive

# Install necessary packages including Miniconda
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
git \
espeak \
espeak-ng \
ffmpeg \
tk \
mecab \
libmecab-dev \
mecab-ipadic-utf8 \
build-essential \
calibre \
&& rm -rf /var/lib/apt/lists/*

RUN ebook-convert --version

# Install Miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh


# Set PATH to include conda
ENV PATH=/opt/conda/bin:$PATH

# Create a conda environment with Python 3.10
RUN conda create -n ebookenv python=3.10 -y

# Activate the conda environment
SHELL ["conda", "run", "-n", "ebookenv", "/bin/bash", "-c"]

# Install Python dependencies using conda and pip
RUN conda install -n ebookenv -c conda-forge \
pydub \
nltk \
mecab-python3 \
&& pip install --no-cache-dir \
bs4 \
beautifulsoup4 \
ebooklib \
translate \
tqdm \
tts==0.21.3 \
unidic \
gradio \
docker

# Download unidic
RUN python -m unidic download

# Download spacy NLP
RUN python -m spacy download en_core_web_sm

# Set the working directory in the container
WORKDIR /ebook2audiobookXTTS

# Clone the ebook2audiobookXTTS repository
RUN git clone https://github.com/DrewThomasson/ebook2audiobookXTTS.git .

# Copy test audio file
COPY ./voices/adult/female/en/default_voice.wav /ebook2audiobookXTTS/

# Run a test to set up XTTS
RUN echo "import torch" > /tmp/script1.py && \
echo "from TTS.api import TTS" >> /tmp/script1.py && \
echo "device = 'cuda' if torch.cuda.is_available() else 'cpu'" >> /tmp/script1.py && \
echo "print(TTS().list_models())" >> /tmp/script1.py && \
echo "tts = TTS('tts_models/multilingual/multi-dataset/xtts_v2').to(device)" >> /tmp/script1.py && \
echo "wav = tts.tts(text='Hello world!', speaker_wav='default_voice.wav', language='en')" >> /tmp/script1.py && \
echo "tts.tts_to_file(text='Hello world!', speaker_wav='default_voice.wav', language='en', file_path='output.wav')" >> /tmp/script1.py && \
yes | python /tmp/script1.py

# Remove the test audio file
RUN rm -f /ebook2audiobookXTTS/output.wav

# Verify that the script exists and has the correct permissions
RUN ls -la /ebook2audiobookXTTS/

# Check if the script exists and log its presence
RUN if [ -f /ebook2audiobookXTTS/custom_model_ebook2audiobookXTTS_with_link_gradio.py ]; then echo "Script found."; else echo "Script not found."; exit 1; fi

# Modify the Python script to set share=True
RUN sed -i 's/demo.launch(share=False)/demo.launch(share=True)/' /ebook2audiobookXTTS/custom_model_ebook2audiobookXTTS_with_link_gradio.py

# Download the punkt package for nltk
RUN python -m nltk.downloader punkt

# Set the command to run your GUI application using the conda environment
CMD ["conda", "run", "--no-capture-output", "-n", "ebookenv", "python", "/ebook2audiobookXTTS/custom_model_ebook2audiobookXTTS_with_link_gradio.py"]

# Use an official NVIDIA CUDA image with cudnn8 and Ubuntu 20.04 as the base
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04
# Set non-interactive installation to avoid timezone and other prompts
ENV DEBIAN_FRONTEND=noninteractive
# Install necessary packages including Miniconda
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
git \
espeak \
espeak-ng \
ffmpeg \
tk \
mecab \
libmecab-dev \
mecab-ipadic-utf8 \
build-essential \
calibre \
&& rm -rf /var/lib/apt/lists/*
RUN ebook-convert --version
# Install Miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh
# Set PATH to include conda
ENV PATH=/opt/conda/bin:$PATH
# Create a conda environment with Python 3.10
RUN conda create -n ebookenv python=3.10 -y
# Activate the conda environment
SHELL ["conda", "run", "-n", "ebookenv", "/bin/bash", "-c"]
# Install Python dependencies using conda and pip
RUN conda install -n ebookenv -c conda-forge \
pydub \
nltk \
mecab-python3 \
&& pip install --no-cache-dir \
bs4 \
beautifulsoup4 \
ebooklib \
translate \
tqdm \
tts==0.21.3 \
unidic \
gradio \
docker
# Download unidic
RUN python -m unidic download
# Download spacy NLP
RUN python -m spacy download en_core_web_sm
# Set the working directory in the container
WORKDIR /ebook2audiobookXTTS
# Clone the ebook2audiobookXTTS repository
RUN git clone https://github.com/DrewThomasson/ebook2audiobookXTTS.git .
# Copy test audio file
COPY ./voices/adult/female/en/default_voice.wav /ebook2audiobookXTTS/
# Run a test to set up XTTS
RUN echo "import torch" > /tmp/script1.py && \
echo "from TTS.api import TTS" >> /tmp/script1.py && \
echo "device = 'cuda' if torch.cuda.is_available() else 'cpu'" >> /tmp/script1.py && \
echo "print(TTS().list_models())" >> /tmp/script1.py && \
echo "tts = TTS('tts_models/multilingual/multi-dataset/xtts_v2').to(device)" >> /tmp/script1.py && \
echo "wav = tts.tts(text='Hello world!', speaker_wav='default_voice.wav', language='en')" >> /tmp/script1.py && \
echo "tts.tts_to_file(text='Hello world!', speaker_wav='default_voice.wav', language='en', file_path='output.wav')" >> /tmp/script1.py && \
yes | python /tmp/script1.py
# Remove the test audio file
RUN rm -f /ebook2audiobookXTTS/output.wav
# Verify that the script exists and has the correct permissions
RUN ls -la /ebook2audiobookXTTS/
# Check if the script exists and log its presence
RUN if [ -f /ebook2audiobookXTTS/custom_model_ebook2audiobookXTTS_with_link_gradio.py ]; then echo "Script found."; else echo "Script not found."; exit 1; fi
# Modify the Python script to set share=True
RUN sed -i 's/demo.launch(share=False)/demo.launch(share=True)/' /ebook2audiobookXTTS/custom_model_ebook2audiobookXTTS_with_link_gradio.py
# Download the punkt package for nltk
RUN python -m nltk.downloader punkt
# Set the command to run your GUI application using the conda environment
CMD ["conda", "run", "--no-capture-output", "-n", "ebookenv", "python", "/ebook2audiobookXTTS/custom_model_ebook2audiobookXTTS_with_link_gradio.py"]
106 changes: 53 additions & 53 deletions DockerfileUtils
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
# Use a minimal Debian-based image with GNU libc 2.35 or later
FROM debian:bookworm-slim

# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENV LANGUAGE=C.UTF-8
ENV QTWEBENGINE_CHROMIUM_FLAGS="--no-sandbox"

# Install required dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget \
xz-utils \
python3 \
python3-pip \
ffmpeg \
libegl1 \
libopengl0 \
libgl1-mesa-glx \
libxcb-cursor0 \
libxkbcommon0 \
libxkbfile1 \
libnss3 \
libx11-6 \
libxext6 \
libxrender1 \
libxtst6 \
libxrandr2 \
libxcomposite1 \
qtbase5-dev \
libqt5webenginecore5 \
libqt5webenginewidgets5 \
libqt5webchannel5 \
libqt5websockets5 && \
rm -rf /var/lib/apt/lists/*

# Install Calibre (specifically for CLI use like ebook-convert)
RUN wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin

# Add Calibre's CLI tools to PATH
ENV PATH="/opt/calibre:${PATH}"

# Default working directory
WORKDIR /app

# Modified ENTRYPOINT to print the command and its arguments
ENTRYPOINT ["/bin/sh", "-c", "echo 'Running command: $0 $@'; exec \"$0\" \"$@\""]

# CMD to pass arguments dynamically
CMD ["sh", "-c"]

# Use a minimal Debian-based image with GNU libc 2.35 or later
FROM debian:bookworm-slim
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENV LANGUAGE=C.UTF-8
ENV QTWEBENGINE_CHROMIUM_FLAGS="--no-sandbox"
# Install required dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget \
xz-utils \
python3 \
python3-pip \
ffmpeg \
libegl1 \
libopengl0 \
libgl1-mesa-glx \
libxcb-cursor0 \
libxkbcommon0 \
libxkbfile1 \
libnss3 \
libx11-6 \
libxext6 \
libxrender1 \
libxtst6 \
libxrandr2 \
libxcomposite1 \
qtbase5-dev \
libqt5webenginecore5 \
libqt5webenginewidgets5 \
libqt5webchannel5 \
libqt5websockets5 && \
rm -rf /var/lib/apt/lists/*
# Install Calibre (specifically for CLI use like ebook-convert)
RUN wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin
# Add Calibre's CLI tools to PATH
ENV PATH="/opt/calibre:${PATH}"
# Default working directory
WORKDIR /app
# Modified ENTRYPOINT to print the command and its arguments
ENTRYPOINT ["/bin/sh", "-c", "echo 'Running command: $0 $@'; exec \"$0\" \"$@\""]
# CMD to pass arguments dynamically
CMD ["sh", "-c"]
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2024 Drew Thomasson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) 2024 Drew Thomasson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading