fix: update GitHub Actions workflow and Docker configurations for improved functionality

This commit is contained in:
remsky 2025-01-12 21:47:31 -07:00
parent f3ba8ad7f3
commit 396261ccdb
6 changed files with 57 additions and 56 deletions

View file

@ -1,55 +1,55 @@
name: Sync develop with master # name: Sync develop with master
on: # on:
push: # push:
branches: # branches:
- master # - master
jobs: # jobs:
sync-develop: # sync-develop:
runs-on: ubuntu-latest # runs-on: ubuntu-latest
permissions: # permissions:
contents: write # contents: write
issues: write # issues: write
steps: # steps:
- name: Checkout repository # - name: Checkout repository
uses: actions/checkout@v4 # uses: actions/checkout@v4
with: # with:
fetch-depth: 0 # fetch-depth: 0
ref: develop # ref: develop
- name: Configure Git # - name: Configure Git
run: | # run: |
git config user.name "GitHub Actions" # git config user.name "GitHub Actions"
git config user.email "actions@github.com" # git config user.email "actions@github.com"
- name: Merge master into develop # - name: Merge master into develop
run: | # run: |
git fetch origin master:master # git fetch origin master:master
git merge --no-ff origin/master -m "chore: Merge master into develop branch" # git merge --no-ff origin/master -m "chore: Merge master into develop branch"
- name: Push changes # - name: Push changes
run: | # run: |
if ! git push origin develop; then # if ! git push origin develop; then
echo "Failed to push to develop branch" # echo "Failed to push to develop branch"
exit 1 # exit 1
fi # fi
- name: Handle Failure # - name: Handle Failure
if: failure() # if: failure()
uses: actions/github-script@v7 # uses: actions/github-script@v7
with: # with:
script: | # script: |
const issueBody = `Automatic merge from master to develop failed. # const issueBody = `Automatic merge from master to develop failed.
Please resolve this manually # Please resolve this manually
Workflow run: ${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`; # Workflow run: ${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`;
await github.rest.issues.create({ # await github.rest.issues.create({
owner: context.repo.owner, # owner: context.repo.owner,
repo: context.repo.repo, # repo: context.repo.repo,
title: '🔄 Automatic master to develop merge failed', # title: '🔄 Automatic master to develop merge failed',
body: issueBody, # body: issueBody,
labels: ['merge-failed', 'automation'] # labels: ['merge-failed', 'automation']
}); # });

View file

@ -61,10 +61,10 @@ services:
# Gradio UI service [Comment out everything below if you don't need it] # Gradio UI service [Comment out everything below if you don't need it]
gradio-ui: gradio-ui:
image: ghcr.io/remsky/kokoro-fastapi-ui:latest # image: ghcr.io/remsky/kokoro-fastapi-ui:latest
# Uncomment below (and comment out above) to build from source instead of using the released image # Uncomment below (and comment out above) to build from source instead of using the released image
# build: build:
# context: ./ui context: ./ui
ports: ports:
- "7860:7860" - "7860:7860"
volumes: volumes:

View file

@ -8,8 +8,6 @@ services:
working_dir: /app/Kokoro-82M working_dir: /app/Kokoro-82M
command: > command: >
sh -c " sh -c "
mkdir -p /app/Kokoro-82M;
cd /app/Kokoro-82M;
if [ \"$$SKIP_MODEL_FETCH\" = \"true\" ]; then if [ \"$$SKIP_MODEL_FETCH\" = \"true\" ]; then
echo 'Skipping model fetch...' && touch .cloned; echo 'Skipping model fetch...' && touch .cloned;
else else

View file

@ -21,7 +21,7 @@ def create_model_column(voice_ids: Optional[list] = None) -> Tuple[gr.Column, di
voice_input = gr.Dropdown( voice_input = gr.Dropdown(
choices=voice_ids, choices=voice_ids,
label="Voice", label="Voice",
value=None, # Start with no value to avoid errors value=voice_ids[0] if voice_ids else None, # Set default value to first item if available
interactive=True, interactive=True,
allow_custom_value=True, # Allow temporary values during updates allow_custom_value=True, # Allow temporary values during updates
) )

View file

@ -12,12 +12,16 @@ def create_output_column() -> Tuple[gr.Column, dict]:
audio_output = gr.Audio(label="Generated Speech", type="filepath") audio_output = gr.Audio(label="Generated Speech", type="filepath")
gr.Markdown("### Generated Files") gr.Markdown("### Generated Files")
# Initialize dropdown with empty choices first
output_files = gr.Dropdown( output_files = gr.Dropdown(
label="Previous Outputs", label="Previous Outputs",
choices=files.list_output_files(), choices=[],
value=None, value=None,
allow_custom_value=True, allow_custom_value=True,
interactive=True,
) )
# Then update choices after component creation
output_files.choices = files.list_output_files()
play_btn = gr.Button("▶️ Play Selected", size="sm") play_btn = gr.Button("▶️ Play Selected", size="sm")
@ -40,4 +44,3 @@ def create_output_column() -> Tuple[gr.Column, dict]:
} }
return col, components return col, components
return col, components

View file

@ -54,7 +54,7 @@ def test_model_column_default_values():
def test_model_column_no_voices(): def test_model_column_no_voices():
"""Test model column creation with no voice IDs""" """Test model column creation with no voice IDs"""
_, components = create_model_column() _, components = create_model_column([])
assert components["voice"].choices == [] assert components["voice"].choices == []
assert components["voice"].value is None assert components["voice"].value is None
@ -96,7 +96,7 @@ def test_output_column_configuration():
# Test output files dropdown # Test output files dropdown
assert components["output_files"].label == "Previous Outputs" assert components["output_files"].label == "Previous Outputs"
assert components["output_files"].allow_custom_value is False assert components["output_files"].allow_custom_value is True
# Test play button # Test play button
assert components["play_btn"].value == "▶️ Play Selected" assert components["play_btn"].value == "▶️ Play Selected"