Skip to content

Commit

Permalink
Merge pull request #264 from ROBERT-MCDOWELL/v25
Browse files Browse the repository at this point in the history
Release v25.2.0
  • Loading branch information
ROBERT-MCDOWELL authored Feb 15, 2025
2 parents 3a982f0 + e3d967a commit 2be50fa
Show file tree
Hide file tree
Showing 56 changed files with 4,925 additions and 4,337 deletions.
48 changes: 16 additions & 32 deletions .github/workflows/run-ubuntu-headless-ebook2audiobook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,80 +25,64 @@ jobs:
- name: Install the system packages
run: |
sudo apt-get update &&
sudo apt-get install -y wget git calibre ffmpeg libmecab-dev mecab mecab-ipadic-utf8 curl &&
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo bash - &&
sudo apt-get install -y nodejs &&
sudo apt-get install -y wget git calibre ffmpeg nodejs espeak espeak-ng rustc cargo libmecab-dev mecab mecab-ipadic-utf8 curl &&
sudo apt-get clean &&
sudo rm -rf /var/lib/apt/lists/*
- name: Install the python requirements
run: pip install -r requirements.txt
run: |
python -m pip install --upgrade pip
pip cache purge
pip install -r requirements.txt
- name: pip Install unict
run: pip install unidic

- name: Download the unict dictionary
run: python -m unidic download




- name: Help command python app.py
run: python app.py --help

- name: Create test files
run: |
mkdir workflow-testing
echo "This is test sentence 1." > workflow-testing/test1.txt
echo "This is test sentence 2." > workflow-testing/test2.txt
echo "This is test sentence 3." > workflow-testing/test3.txt
echo "This is test sentence 4." > workflow-testing/test4.txt
echo "This is test sentence 5." > workflow-testing/test5.txt
echo "This is test sentence 1 ." > workflow-testing/test1.txt
echo "This is test sentence 2 ." > workflow-testing/test2.txt
echo "This is test sentence 3 ." > workflow-testing/test3.txt
echo "This is test sentence 4 ." > workflow-testing/test4.txt
echo "This is test sentence 5 ." > workflow-testing/test5.txt
- name: Default headless single test python app.py
run: python app.py --headless --ebook "workflow-testing/test1.txt"

- name: Default headless batch test python app.py
run: python app.py --headless --ebooks_dir "workflow-testing"


- name: Default headless Custom-Voice single test python app.py
run: python app.py --headless --ebook "workflow-testing/test1.txt" --voice "voices/eng/elder/male/DavidAttenborough_16000.wav"
run: python app.py --headless --ebook "workflow-testing/test1.txt" --voice "voices/eng/elder/male/DavidAttenborough_24000.wav"

- name: Default headless Custom-Voice batch test python app.py
run: python app.py --headless --ebooks_dir "workflow-testing" --voice "voices/eng/elder/male/DavidAttenborough_16000.wav"



run: python app.py --headless --ebooks_dir "workflow-testing" --voice "voices/eng/elder/male/DavidAttenborough_24000.wav"

- name: English Fairseq headless single test python app.py
run: python app.py --headless --language "eng" --ebook "workflow-testing/test1.txt"

- name: English Fairseq headless batch test python app.py
run: python app.py --headless --language "eng" --ebooks_dir "workflow-testing"


- name: English Fairseq Custom-Voice headless single test python app.py
run: python app.py --headless --language "eng" --ebook "workflow-testing/test1.txt" --voice "voices/eng/elder/male/DavidAttenborough_16000.wav"
run: python app.py --headless --language "eng" --ebook "workflow-testing/test1.txt" --voice "voices/eng/elder/male/DavidAttenborough_24000.wav"

- name: English Fairseq Custom-Voice headless batch test python app.py
run: python app.py --headless --language "eng" --ebooks_dir "workflow-testing" --voice "voices/eng/elder/male/DavidAttenborough_16000.wav"



run: python app.py --headless --language "eng" --ebooks_dir "workflow-testing" --voice "voices/eng/elder/male/DavidAttenborough_24000.wav"

- name: Unusual Fairseq headless single test python app.py
run: python app.py --headless --language "urd-script_devanagari" --ebook "workflow-testing/test1.txt"

- name: Unusual Fairseq headless batch test python app.py
run: python app.py --headless --language "urd-script_devanagari" --ebooks_dir "workflow-testing"


- name: Unusual Fairseq Custom-Voice headless single test python app.py
run: python app.py --headless --language "urd-script_devanagari" --ebook "workflow-testing/test1.txt" --voice "voices/eng/elder/male/DavidAttenborough_16000.wav"
run: python app.py --headless --language "urd-script_devanagari" --ebook "workflow-testing/test1.txt" --voice "voices/eng/elder/male/DavidAttenborough_24000.wav"

- name: Unusual Fairseq Custom-Voice headless batch test python app.py
run: python app.py --headless --language "urd-script_devanagari" --ebooks_dir "workflow-testing" --voice "voices/eng/elder/male/DavidAttenborough_16000.wav"
run: python app.py --headless --language "urd-script_devanagari" --ebooks_dir "workflow-testing" --voice "voices/eng/elder/male/DavidAttenborough_24000.wav"
102 changes: 57 additions & 45 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,45 +1,57 @@
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile

# Build with the command:
# docker build --platform linux/amd64 -t ebook2audiobook .

FROM python:3.12

# Create and switch to a non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Set a working directory for temporary operations
WORKDIR /app

# Install system packages
USER root
RUN apt-get update && \
apt-get install -y wget git calibre ffmpeg libmecab-dev mecab mecab-ipadic && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Clone the GitHub repository and set it as the working directory
USER root
RUN apt-get update && apt-get install -y git && apt-get clean && rm -rf /var/lib/apt/lists/*
USER user
RUN git clone https://github.com/DrewThomasson/ebook2audiobook.git /home/user/app

# Set the cloned repository as the base working directory
WORKDIR /home/user/app

#Install Python dependences from the ebook2audiobook repo
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Do a test run to make sure that the base models are pre-downloaded and baked into the image
# RUN echo "This is a test sentence." > test.txt
# RUN python app.py --headless --ebook test.txt
# RUN rm test.txt

# Expose the required port
EXPOSE 7860

# Start the Gradio app from the repository
CMD ["python", "app.py"]
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile

# Build with the command:
# docker build --platform linux/amd64 -t athomasson2/ebook2audiobook:dev_2.1_small .

FROM python:3.12

# Create and switch to a non-root user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Set a working directory for temporary operations
WORKDIR /app

# Install system packages
USER root
RUN apt-get update && \
apt-get install -y wget git calibre ffmpeg libmecab-dev mecab mecab-ipadic-utf8 curl && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*



# Clone the GitHub repository and set it as the working directory
USER root
RUN apt-get update && apt-get install -y git && apt-get clean && rm -rf /var/lib/apt/lists/*
USER user
RUN git clone https://github.com/DrewThomasson/ebook2audiobook.git /home/user/app

# Set the cloned repository as the base working directory
WORKDIR /home/user/app

# Install Python dependencies
# Install UniDic and its dependencies
RUN pip install --no-cache-dir unidic-lite unidic
RUN python3 -m unidic download # Download UniDic
RUN mkdir -p /home/user/.local/share/unidic && \
mv ~/.local/share/unidic/* /home/user/.local/share/unidic/ || true
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Set environment variable to ensure MeCab can locate UniDic
ENV UNIDIC_DIR=/home/user/.local/share/unidic

# Do a test run to make sure that the base models are pre-downloaded and baked into the image
#RUN echo "This is a test sentence." > test.txt
#RUN python app.py --headless --ebook test.txt --script_mode full_docker
#RUN rm test.txt

# Expose the required port
EXPOSE 7860

# Start the Gradio app with the required flag
CMD ["python", "app.py", "--script_mode", "full_docker"]
53 changes: 0 additions & 53 deletions DockerfileUtils

This file was deleted.

Loading

0 comments on commit 2be50fa

Please sign in to comment.