Add Flutter text to speech demo (#1087)
This commit is contained in:
118
.github/workflows/flutter-windows-x64.yaml
vendored
118
.github/workflows/flutter-windows-x64.yaml
vendored
@@ -14,8 +14,8 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
flutter_windows_x64:
|
||||
name: windows x64 ${{ matrix.index }}
|
||||
asr:
|
||||
name: asr ${{ matrix.index }}/${{ matrix.total }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -76,13 +76,8 @@ jobs:
|
||||
cd ../../
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: sherpa-onnx-win-x64-${{ matrix.index }}
|
||||
path: ./*.tar.bz2
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') || contains(github.ref, 'refs/tags/'))
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' || github.repository_owner == 'csu-fangjun') && ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') || contains(github.ref, 'refs/tags/'))
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
uses: nick-fields/retry@v3
|
||||
@@ -98,13 +93,116 @@ jobs:
|
||||
export GIT_LFS_SKIP_SMUDGE=1
|
||||
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||
|
||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
||||
|
||||
git clone https://huggingface.co/csukuangfj/sherpa-onnx-flutter huggingface
|
||||
cd huggingface
|
||||
git fetch
|
||||
git pull
|
||||
git merge -m "merge remote" --ff origin main
|
||||
mkdir -p flutter/asr
|
||||
cp -v ../*.tar.bz2 ./flutter/asr
|
||||
|
||||
dst=flutter/asr/windows/$SHERPA_ONNX_VERSION
|
||||
mkdir -p $dst
|
||||
cp -v ../*.tar.bz2 $dst
|
||||
|
||||
git status
|
||||
git lfs track "*.bz2"
|
||||
git add .
|
||||
git commit -m "add more files"
|
||||
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-flutter main
|
||||
|
||||
tts:
|
||||
name: tts ${{ matrix.index }}/${{ matrix.total }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest]
|
||||
total: ["20"]
|
||||
index: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "11", "12", "13", "14", "15", "16", "17", "18", "19"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Python dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip jinja2 iso639-lang
|
||||
|
||||
- name: Setup Flutter SDK
|
||||
uses: flutter-actions/setup-flutter@v3
|
||||
with:
|
||||
channel: stable
|
||||
version: latest
|
||||
|
||||
- name: Display PWD
|
||||
shell: bash
|
||||
run: |
|
||||
echo "pwd: $PWD"
|
||||
ls -lh
|
||||
|
||||
- name: Display machine info
|
||||
shell: bash
|
||||
run: |
|
||||
uname -a
|
||||
|
||||
- name: Display flutter info
|
||||
shell: bash
|
||||
run: |
|
||||
which flutter
|
||||
which dart
|
||||
|
||||
flutter --version
|
||||
dart --version
|
||||
flutter doctor
|
||||
|
||||
- name: Build flutter
|
||||
shell: bash
|
||||
run: |
|
||||
cd scripts/flutter
|
||||
|
||||
total=${{ matrix.total }}
|
||||
index=${{ matrix.index }}
|
||||
|
||||
./generate-tts.py --total $total --index $index
|
||||
|
||||
chmod +x *.sh
|
||||
./build-windows-tts.sh
|
||||
cd ../../
|
||||
ls -lh *.tar.bz2
|
||||
|
||||
- name: Publish to huggingface
|
||||
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' || github.repository_owner == 'csu-fangjun') && ((github.event_name == 'push' || github.event_name == 'workflow_dispatch') || contains(github.ref, 'refs/tags/'))
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
max_attempts: 20
|
||||
timeout_seconds: 200
|
||||
shell: bash
|
||||
command: |
|
||||
git config --global user.email "csukuangfj@gmail.com"
|
||||
git config --global user.name "Fangjun Kuang"
|
||||
|
||||
rm -rf huggingface
|
||||
export GIT_LFS_SKIP_SMUDGE=1
|
||||
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||
|
||||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION"
|
||||
|
||||
git clone https://huggingface.co/csukuangfj/sherpa-onnx-flutter huggingface
|
||||
cd huggingface
|
||||
git fetch
|
||||
git pull
|
||||
git merge -m "merge remote" --ff origin main
|
||||
|
||||
dst=flutter/tts/windows/$SHERPA_ONNX_VERSION
|
||||
mkdir -p $dst
|
||||
cp -v ../*.tar.bz2 $dst
|
||||
|
||||
git status
|
||||
git lfs track "*.bz2"
|
||||
|
||||
Reference in New Issue
Block a user