From 396261ccdb31fe32290f5bdcb8a3a398632cce79 Mon Sep 17 00:00:00 2001 From: remsky Date: Sun, 12 Jan 2025 21:47:31 -0700 Subject: [PATCH] fix: update GitHub Actions workflow and Docker configurations for improved functionality --- .github/workflows/sync-develop.yml | 92 +++++++++++++++--------------- docker-compose.cpu.yml | 6 +- docker-compose.yml | 2 - ui/lib/components/model.py | 2 +- ui/lib/components/output.py | 7 ++- ui/tests/test_components.py | 4 +- 6 files changed, 57 insertions(+), 56 deletions(-) diff --git a/.github/workflows/sync-develop.yml b/.github/workflows/sync-develop.yml index 2e0cfd5..56b881f 100644 --- a/.github/workflows/sync-develop.yml +++ b/.github/workflows/sync-develop.yml @@ -1,55 +1,55 @@ -name: Sync develop with master +# name: Sync develop with master -on: - push: - branches: - - master +# on: +# push: +# branches: +# - master -jobs: - sync-develop: - runs-on: ubuntu-latest - permissions: - contents: write - issues: write - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: develop +# jobs: +# sync-develop: +# runs-on: ubuntu-latest +# permissions: +# contents: write +# issues: write +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# ref: develop - - name: Configure Git - run: | - git config user.name "GitHub Actions" - git config user.email "actions@github.com" +# - name: Configure Git +# run: | +# git config user.name "GitHub Actions" +# git config user.email "actions@github.com" - - name: Merge master into develop - run: | - git fetch origin master:master - git merge --no-ff origin/master -m "chore: Merge master into develop branch" +# - name: Merge master into develop +# run: | +# git fetch origin master:master +# git merge --no-ff origin/master -m "chore: Merge master into develop branch" - - name: Push changes - run: | - if ! git push origin develop; then - echo "Failed to push to develop branch" - exit 1 - fi +# - name: Push changes +# run: | +# if ! git push origin develop; then +# echo "Failed to push to develop branch" +# exit 1 +# fi - - name: Handle Failure - if: failure() - uses: actions/github-script@v7 - with: - script: | - const issueBody = `Automatic merge from master to develop failed. +# - name: Handle Failure +# if: failure() +# uses: actions/github-script@v7 +# with: +# script: | +# 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({ - owner: context.repo.owner, - repo: context.repo.repo, - title: '🔄 Automatic master to develop merge failed', - body: issueBody, - labels: ['merge-failed', 'automation'] - }); +# await github.rest.issues.create({ +# owner: context.repo.owner, +# repo: context.repo.repo, +# title: '🔄 Automatic master to develop merge failed', +# body: issueBody, +# labels: ['merge-failed', 'automation'] +# }); diff --git a/docker-compose.cpu.yml b/docker-compose.cpu.yml index d965f5d..cb7a3cf 100644 --- a/docker-compose.cpu.yml +++ b/docker-compose.cpu.yml @@ -61,10 +61,10 @@ services: # Gradio UI service [Comment out everything below if you don't need it] 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 - # build: - # context: ./ui + build: + context: ./ui ports: - "7860:7860" volumes: diff --git a/docker-compose.yml b/docker-compose.yml index 7970695..ddca25f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,8 +8,6 @@ services: working_dir: /app/Kokoro-82M command: > sh -c " - mkdir -p /app/Kokoro-82M; - cd /app/Kokoro-82M; if [ \"$$SKIP_MODEL_FETCH\" = \"true\" ]; then echo 'Skipping model fetch...' && touch .cloned; else diff --git a/ui/lib/components/model.py b/ui/lib/components/model.py index 5ffa3ce..2046b32 100644 --- a/ui/lib/components/model.py +++ b/ui/lib/components/model.py @@ -21,7 +21,7 @@ def create_model_column(voice_ids: Optional[list] = None) -> Tuple[gr.Column, di voice_input = gr.Dropdown( choices=voice_ids, 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, allow_custom_value=True, # Allow temporary values during updates ) diff --git a/ui/lib/components/output.py b/ui/lib/components/output.py index 89a9ca4..640deba 100644 --- a/ui/lib/components/output.py +++ b/ui/lib/components/output.py @@ -12,12 +12,16 @@ def create_output_column() -> Tuple[gr.Column, dict]: audio_output = gr.Audio(label="Generated Speech", type="filepath") gr.Markdown("### Generated Files") + # Initialize dropdown with empty choices first output_files = gr.Dropdown( label="Previous Outputs", - choices=files.list_output_files(), + choices=[], value=None, 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") @@ -40,4 +44,3 @@ def create_output_column() -> Tuple[gr.Column, dict]: } return col, components - return col, components diff --git a/ui/tests/test_components.py b/ui/tests/test_components.py index b125cb7..d9576c0 100644 --- a/ui/tests/test_components.py +++ b/ui/tests/test_components.py @@ -54,7 +54,7 @@ def test_model_column_default_values(): def test_model_column_no_voices(): """Test model column creation with no voice IDs""" - _, components = create_model_column() + _, components = create_model_column([]) assert components["voice"].choices == [] assert components["voice"].value is None @@ -96,7 +96,7 @@ def test_output_column_configuration(): # Test output files dropdown 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 assert components["play_btn"].value == "▶️ Play Selected"