Skip to content

Commit

Permalink
add test workflows, fix minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rsxdalv committed Oct 24, 2024
1 parent 26f48a4 commit 0133c48
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 4 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/test-pip-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test pip install on 3 platforms

on:
workflow_dispatch:
# push:
# branches:
# - main

jobs:
build:
strategy:
max-parallel: 4
matrix:
platform: [ubuntu-latest, macos-12, windows-latest]
python-version: ["3.10"]

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install locally
# if: matrix.platform == 'windows-latest'
# also test with uv
run: |
python -m pip install install torch==2.3.1
python -m pip install --upgrade pip==23.3.2
python -m pip install -r requirements.txt
python -m pip install -r requirements_bark_hubert_quantizer.txt
python -m pip install -r requirements_rvc.txt
python -m pip install -r requirements_audiocraft_0.txt
python -m pip install -r requirements_audiocraft.txt
python -m pip install -r requirements_styletts2.txt
python -m pip install -r requirements_vall_e.txt
python -m pip install -r requirements_maha_tts.txt
python -m pip install -r requirements_stable_audio.txt
python -m pip install hydra-core==1.3.2
python -m pip install nvidia-ml-py
# - name: Check installation
# working-directory: /tmp
# run: python $GITHUB_WORKSPACE/scripts/check_installation.py

- name: Lint with ruff
run: ruff check .
56 changes: 56 additions & 0 deletions .github/workflows/test-react-ui.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Test if React UI builds

on:
push:
branches: ["main"]

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
working-directory: react-ui
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "22"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Restore cache
uses: actions/cache@v3
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
working-directory: react-ui
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Next.js
working-directory: react-ui
run: ${{ steps.detect-package-manager.outputs.runner }} next build
- name: Static HTML export with Next.js
working-directory: react-ui
run: ${{ steps.detect-package-manager.outputs.runner }} next export
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ safetensors
# safetensors==0.3.1 # Until they fix it
ffmpeg-python # Apache 2.0
# gradio==3.48.0
gradio>=5.1.0 # MIT License
gradio>=5.3.0 # MIT License
python-dotenv==1.0.0
soundfile==0.12.1; sys_platform == 'win32' # torchaudio
# sox # torchaudio for linux
Expand Down
1 change: 1 addition & 0 deletions server.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: E402
# %%
print("Starting server...\n")
import tts_webui.utils.setup_or_recover as setup_or_recover
Expand Down
2 changes: 1 addition & 1 deletion tts_webui/bark/bark_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import gradio as gr

from tts_webui.config.config import config
from tts_webui.bark.clone.tab_voice_clone import tab_voice_clone
# from tts_webui.bark.clone.tab_voice_clone import tab_voice_clone
from tts_webui.history_tab.voices_tab import voices_tab
from tts_webui.bark.settings_tab_bark import settings_tab_bark

Expand Down
2 changes: 0 additions & 2 deletions tts_webui/config/load_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"inbrowser": True,
"share": False,
"debug": False,
"enable_queue": True,
"max_threads": 40,
"auth": None,
"auth_message": None,
Expand All @@ -35,7 +34,6 @@
"ssl_verify": True,
"quiet": True,
"show_api": True,
"file_directories": None,
"_frontend": True,
},
"extensions": {
Expand Down

0 comments on commit 0133c48

Please sign in to comment.