Fangjun Kuang
Committed by GitHub

Upload speaker embedding models to huggingface (#1428)

See also
https://huggingface.co/spaces/k2-fsa/speaker-diarization
@@ -15,7 +15,7 @@ jobs: @@ -15,7 +15,7 @@ jobs:
15 strategy: 15 strategy:
16 fail-fast: false 16 fail-fast: false
17 matrix: 17 matrix:
18 - os: [macos-latest] 18 + os: [ubuntu-latest]
19 python-version: ["3.8"] 19 python-version: ["3.8"]
20 20
21 steps: 21 steps:
@@ -43,3 +43,28 @@ jobs: @@ -43,3 +43,28 @@ jobs:
43 repo_name: k2-fsa/sherpa-onnx 43 repo_name: k2-fsa/sherpa-onnx
44 repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} 44 repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
45 tag: speaker-recongition-models 45 tag: speaker-recongition-models
  46 +
  47 + - name: Publish to huggingface
  48 + env:
  49 + HF_TOKEN: ${{ secrets.HF_TOKEN }}
  50 + uses: nick-fields/retry@v3
  51 + with:
  52 + max_attempts: 20
  53 + timeout_seconds: 200
  54 + shell: bash
  55 + command: |
  56 + git config --global user.email "csukuangfj@gmail.com"
  57 + git config --global user.name "Fangjun Kuang"
  58 +
  59 + d=speaker-embedding-models
  60 + export GIT_LFS_SKIP_SMUDGE=1
  61 + export GIT_CLONE_PROTECTION_ACTIVE=false
  62 + git clone https://huggingface.co/csukuangfj/$d huggingface
  63 + mv -v ./*.onnx ./huggingface
  64 + cd huggingface
  65 + git lfs track "*.onnx"
  66 + git status
  67 + git add .
  68 + git status
  69 + git commit -m "add models"
  70 + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/$d main
@@ -15,7 +15,7 @@ jobs: @@ -15,7 +15,7 @@ jobs:
15 strategy: 15 strategy:
16 fail-fast: false 16 fail-fast: false
17 matrix: 17 matrix:
18 - os: [ubuntu-latest] 18 + os: [macos-latest]
19 python-version: ["3.10"] 19 python-version: ["3.10"]
20 20
21 steps: 21 steps:
@@ -43,3 +43,28 @@ jobs: @@ -43,3 +43,28 @@ jobs:
43 repo_name: k2-fsa/sherpa-onnx 43 repo_name: k2-fsa/sherpa-onnx
44 repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} 44 repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
45 tag: speaker-recongition-models 45 tag: speaker-recongition-models
  46 +
  47 + - name: Publish to huggingface
  48 + env:
  49 + HF_TOKEN: ${{ secrets.HF_TOKEN }}
  50 + uses: nick-fields/retry@v3
  51 + with:
  52 + max_attempts: 20
  53 + timeout_seconds: 200
  54 + shell: bash
  55 + command: |
  56 + git config --global user.email "csukuangfj@gmail.com"
  57 + git config --global user.name "Fangjun Kuang"
  58 +
  59 + d=speaker-embedding-models
  60 + export GIT_LFS_SKIP_SMUDGE=1
  61 + export GIT_CLONE_PROTECTION_ACTIVE=false
  62 + git clone https://huggingface.co/csukuangfj/$d huggingface
  63 + mv -v ./*.onnx ./huggingface
  64 + cd huggingface
  65 + git lfs track "*.onnx"
  66 + git status
  67 + git add .
  68 + git status
  69 + git commit -m "add models"
  70 + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/$d main
@@ -48,3 +48,28 @@ jobs: @@ -48,3 +48,28 @@ jobs:
48 repo_name: k2-fsa/sherpa-onnx 48 repo_name: k2-fsa/sherpa-onnx
49 repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} 49 repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }}
50 tag: speaker-recongition-models 50 tag: speaker-recongition-models
  51 +
  52 + - name: Publish to huggingface
  53 + env:
  54 + HF_TOKEN: ${{ secrets.HF_TOKEN }}
  55 + uses: nick-fields/retry@v3
  56 + with:
  57 + max_attempts: 20
  58 + timeout_seconds: 200
  59 + shell: bash
  60 + command: |
  61 + git config --global user.email "csukuangfj@gmail.com"
  62 + git config --global user.name "Fangjun Kuang"
  63 +
  64 + d=speaker-embedding-models
  65 + export GIT_LFS_SKIP_SMUDGE=1
  66 + export GIT_CLONE_PROTECTION_ACTIVE=false
  67 + git clone https://huggingface.co/csukuangfj/$d huggingface
  68 + mv -v ./*.onnx ./huggingface
  69 + cd huggingface
  70 + git lfs track "*.onnx"
  71 + git status
  72 + git add .
  73 + git status
  74 + git commit -m "add models"
  75 + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/$d main
@@ -88,14 +88,15 @@ with the following APIs @@ -88,14 +88,15 @@ with the following APIs
88 <summary>You can visit the following Huggingface spaces to try sherpa-onnx without 88 <summary>You can visit the following Huggingface spaces to try sherpa-onnx without
89 installing anything. All you need is a browser.</summary> 89 installing anything. All you need is a browser.</summary>
90 90
91 -| Description | URL |  
92 -|-------------------------------------------------------|------------------------------------|  
93 -| Speech recognition | [Click me][hf-space-asr] |  
94 -| Speech recognition with [Whisper][Whisper] | [Click me][hf-space-asr-whisper] |  
95 -| Speech synthesis | [Click me][hf-space-tts] |  
96 -| Generate subtitles | [Click me][hf-space-subtitle] |  
97 -| Audio tagging | [Click me][hf-space-audio-tagging] |  
98 -| Spoken language identification with [Whisper][Whisper]| [Click me][hf-space-slid-whisper] | 91 +| Description | URL |
  92 +|-------------------------------------------------------|-----------------------------------------|
  93 +| Speaker diarization | [Click me][hf-space-speaker-diarization]|
  94 +| Speech recognition | [Click me][hf-space-asr] |
  95 +| Speech recognition with [Whisper][Whisper] | [Click me][hf-space-asr-whisper] |
  96 +| Speech synthesis | [Click me][hf-space-tts] |
  97 +| Generate subtitles | [Click me][hf-space-subtitle] |
  98 +| Audio tagging | [Click me][hf-space-audio-tagging] |
  99 +| Spoken language identification with [Whisper][Whisper]| [Click me][hf-space-slid-whisper] |
99 100
100 We also have spaces built using WebAssembly. They are listed below: 101 We also have spaces built using WebAssembly. They are listed below:
101 102
@@ -240,6 +241,7 @@ Video demo in Chinese: [爆了!炫神教你开打字挂!真正影响胜率 @@ -240,6 +241,7 @@ Video demo in Chinese: [爆了!炫神教你开打字挂!真正影响胜率
240 [VisionFive 2]: https://www.starfivetech.com/en/site/boards 241 [VisionFive 2]: https://www.starfivetech.com/en/site/boards
241 [旭日X3派]: https://developer.horizon.ai/api/v1/fileData/documents_pi/index.html 242 [旭日X3派]: https://developer.horizon.ai/api/v1/fileData/documents_pi/index.html
242 [爱芯派]: https://wiki.sipeed.com/hardware/zh/maixIII/ax-pi/axpi.html 243 [爱芯派]: https://wiki.sipeed.com/hardware/zh/maixIII/ax-pi/axpi.html
  244 +[hf-space-speaker-diarization]: https://huggingface.co/spaces/k2-fsa/speaker-diarization
243 [hf-space-asr]: https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition 245 [hf-space-asr]: https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition
244 [Whisper]: https://github.com/openai/whisper 246 [Whisper]: https://github.com/openai/whisper
245 [hf-space-asr-whisper]: https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition-with-whisper 247 [hf-space-asr-whisper]: https://huggingface.co/spaces/k2-fsa/automatic-speech-recognition-with-whisper
@@ -4,10 +4,10 @@ set -e @@ -4,10 +4,10 @@ set -e
4 4
5 function install_3d_speaker() { 5 function install_3d_speaker() {
6 echo "Install 3D-Speaker" 6 echo "Install 3D-Speaker"
7 - git clone https://github.com/alibaba-damo-academy/3D-Speaker.git 7 + git clone https://github.com/modelscope/3D-Speaker
8 pushd 3D-Speaker 8 pushd 3D-Speaker
9 pip install -q -r ./requirements.txt 9 pip install -q -r ./requirements.txt
10 - pip install -q modelscope onnx onnxruntime kaldi-native-fbank 10 + pip install -q modelscope==1.14.0 onnx onnxruntime kaldi-native-fbank
11 popd 11 popd
12 } 12 }
13 13
@@ -7,14 +7,17 @@ function install_nemo() { @@ -7,14 +7,17 @@ function install_nemo() {
7 curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py 7 curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
8 python3 get-pip.py 8 python3 get-pip.py
9 9
10 - pip install torch==2.1.0+cpu torchaudio==2.1.0+cpu -f https://download.pytorch.org/whl/torch_stable.html 10 + pip install torch==2.1.0 torchaudio==2.1.0 -f https://download.pytorch.org/whl/torch_stable.html
11 11
12 - pip install wget text-unidecode matplotlib>=3.3.2 onnx onnxruntime pybind11 Cython einops kaldi-native-fbank soundfile 12 + pip install -qq wget text-unidecode matplotlib>=3.3.2 onnx onnxruntime pybind11 Cython einops kaldi-native-fbank soundfile
  13 + pip install -qq ipython
13 14
14 - sudo apt-get install -q -y sox libsndfile1 ffmpeg python3-pip 15 + # sudo apt-get install -q -y sox libsndfile1 ffmpeg python3-pip ipython
15 16
16 BRANCH='main' 17 BRANCH='main'
17 python3 -m pip install git+https://github.com/NVIDIA/NeMo.git@$BRANCH#egg=nemo_toolkit[asr] 18 python3 -m pip install git+https://github.com/NVIDIA/NeMo.git@$BRANCH#egg=nemo_toolkit[asr]
  19 +
  20 + pip install numpy==1.26.4
18 } 21 }
19 22
20 install_nemo 23 install_nemo