upload to huggingface

This commit is contained in:
Fangjun Kuang 2024-04-09 15:44:49 +08:00
parent c48a67f8ae
commit 6a60ceca21
2 changed files with 7 additions and 8 deletions

View File

@ -81,11 +81,11 @@ function test_pretrained() {
done done
log "prepare data for uploading to huggingface" log "prepare data for uploading to huggingface"
dst=/icefall/onnx-model dst=/icefall/model-onnx
mkdir -p $dst mkdir -p $dst
cp -v $repo/*.onnx $dst/ cp -v $repo/exp/*.onnx $dst/
cp -v $repo/data/* $dst/ cp -v $repo/data/* $dst/
cp -a $repo/test_wavs $dst cp -av $repo/test_wavs $dst
ls -lh $dst ls -lh $dst
ls -lh $dst/test_wavs ls -lh $dst/test_wavs

View File

@ -81,7 +81,7 @@ jobs:
ls -lh ./model-onnx/* ls -lh ./model-onnx/*
- name: Upload model to huggingface - name: Upload model to huggingface
if: matrix.python-version == '3.9' && matrix.torch-version == '2.2.0' if: matrix.python-version == '3.9' && matrix.torch-version == '2.2.0' && github.event_name == 'push'
env: env:
HF_TOKEN: ${{ secrets.HF_TOKEN }} HF_TOKEN: ${{ secrets.HF_TOKEN }}
uses: nick-fields/retry@v3 uses: nick-fields/retry@v3
@ -110,11 +110,11 @@ jobs:
git commit -m "update models" git commit -m "update models"
git status git status
git push https://csukuangfj:$HF_TOKEN@huggingface.co/sherpa-onnx-zipformer-audio-tagging-2024-04-09 main || true git push https://csukuangfj:$HF_TOKEN@huggingface.co/k2-fsa/sherpa-onnx-zipformer-audio-tagging-2024-04-09 main || true
rm -rf huggingface rm -rf huggingface
- name: Prepare for release - name: Prepare for release
if: matrix.python-version == '3.9' && matrix.torch-version == '2.2.0' if: matrix.python-version == '3.9' && matrix.torch-version == '2.2.0' && github.event_name == 'push'
shell: bash shell: bash
run: | run: |
d=sherpa-onnx-zipformer-audio-tagging-2024-04-09 d=sherpa-onnx-zipformer-audio-tagging-2024-04-09
@ -123,8 +123,7 @@ jobs:
ls -lh ls -lh
- name: Release exported onnx models - name: Release exported onnx models
# if: matrix.python-version == '3.9' && matrix.torch-version == '2.2.0' && github.event_name == 'push' if: matrix.python-version == '3.9' && matrix.torch-version == '2.2.0' && github.event_name == 'push'
if: matrix.python-version == '3.9' && matrix.torch-version == '2.2.0'
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
file_glob: true file_glob: true