Skip to content

Commit 48e9a92

Browse files
authored
Fix CI for JavaScript and Python APIs. (k2-fsa#901)
1 parent 03d9af9 commit 48e9a92

File tree

10 files changed

+20
-58
lines changed

10 files changed

+20
-58
lines changed

.github/scripts/test-python.sh

+5
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ if [[ x$OS != x'windows-latest' ]]; then
220220
ls -lh
221221

222222
ls -lh $repo
223+
popd
223224

224225
python3 ./python-api-examples/online-decode-files.py \
225226
--tokens=$repo/tokens.txt \
@@ -297,6 +298,7 @@ if [[ x$OS != x'windows-latest' ]]; then
297298
repo=$dir/sherpa-onnx-paraformer-zh-2023-03-28
298299

299300
ls -lh $repo
301+
popd
300302

301303
python3 ./python-api-examples/offline-decode-files.py \
302304
--tokens=$repo/tokens.txt \
@@ -331,6 +333,7 @@ log "Start testing ${repo_url}"
331333
repo=$dir/sherpa-onnx-nemo-ctc-en-citrinet-512
332334

333335
ls -lh $repo
336+
popd
334337

335338
python3 ./python-api-examples/offline-decode-files.py \
336339
--tokens=$repo/tokens.txt \
@@ -376,6 +379,7 @@ log "Start testing ${repo}"
376379
pushd $dir
377380
curl -LS -O https://github.com/pkufool/keyword-spotting-models/releases/download/v0.1/sherpa-onnx-kws-zipformer-gigaspeech-3.3M-2024-01-01.tar.bz
378381
tar xf sherpa-onnx-kws-zipformer-gigaspeech-3.3M-2024-01-01.tar.bz
382+
rm sherpa-onnx-kws-zipformer-gigaspeech-3.3M-2024-01-01.tar.bz
379383
popd
380384

381385
repo=$dir/$repo
@@ -401,6 +405,7 @@ if [[ x$OS != x'windows-latest' ]]; then
401405
pushd $dir
402406
curl -LS -O https://github.com/pkufool/keyword-spotting-models/releases/download/v0.1/sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01.tar.bz
403407
tar xf sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01.tar.bz
408+
rm sherpa-onnx-kws-zipformer-wenetspeech-3.3M-2024-01-01.tar.bz
404409
popd
405410

406411
repo=$dir/$repo

.github/workflows/arm-linux-gnueabihf.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ jobs:
173173
cp -a build-arm-linux-gnueabihf/install/lib $dst/
174174
rm -v $dst/lib/libasound.so
175175
rm -v $dst/lib/libonnxruntime.so
176-
rm -v $dst/lib/libsherpa-onnx-fst.so
177-
rm -v $dst/lib/libsherpa-onnx-fstfar.so
178176
fi
179177
180178
tree $dst

.github/workflows/linux.yaml

-35
Original file line numberDiff line numberDiff line change
@@ -296,41 +296,6 @@ jobs:
296296
tar cjvf ${dst}.tar.bz2 $dst
297297
du -h -d1 .
298298
299-
- name: Publish to huggingface
300-
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && matrix.build_type == 'Release'
301-
env:
302-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
303-
uses: nick-fields/retry@v3
304-
with:
305-
max_attempts: 20
306-
timeout_seconds: 200
307-
shell: bash
308-
command: |
309-
du -h -d1 .
310-
git config --global user.email "csukuangfj@gmail.com"
311-
git config --global user.name "Fangjun Kuang"
312-
313-
rm -rf huggingface
314-
export GIT_CLONE_PROTECTION_ACTIVE=false
315-
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface
316-
du -h -d1 .
317-
318-
cd huggingface
319-
git lfs pull
320-
mkdir -p linux-x64
321-
322-
cp -v ../sherpa-onnx-*.tar.bz2 ./linux-x64
323-
324-
git status
325-
git lfs track "*.bz2"
326-
327-
git add .
328-
329-
git commit -m "upload sherpa-onnx-${SHERPA_ONNX_VERSION}"
330-
331-
git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main
332-
du -h -d1 .
333-
334299
- name: Release pre-compiled binaries and libs for linux x64
335300
if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') && matrix.build_type == 'Release'
336301
uses: svenstaro/upload-release-action@v2

.github/workflows/riscv64-linux.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,6 @@ jobs:
210210
cp -a build-riscv64-linux-gnu/install/lib $dst/
211211
rm -fv $dst/lib/libasound.so
212212
rm -fv $dst/lib/libonnxruntime.so
213-
rm -fv $dst/lib/libsherpa-onnx-fst.so
214-
rm -fv $dst/lib/libsherpa-onnx-fstfar.so
215213
fi
216214
217215
tree $dst

cmake/openfst.cmake

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
function(download_openfst)
44
include(FetchContent)
55

6-
set(openfst_URL "https://github.com/csukuangfj/openfst/archive/refs/tags/sherpa-onnx-2024-04-09.tar.gz")
7-
set(openfst_URL2 "https://hub.nuaa.cf/csukuangfj/openfst/archive/refs/tags/sherpa-onnx-2024-04-09.tar.gz")
8-
set(openfst_HASH "SHA256=d6bdb1700fa38938807184c69a5abe133e730af80822bb85c8f228768a969b92")
6+
set(openfst_URL "https://github.com/csukuangfj/openfst/archive/refs/tags/sherpa-onnx-2024-05-22-2.tar.gz")
7+
set(openfst_URL2 "https://hub.nuaa.cf/csukuangfj/openfst/archive/refs/tags/sherpa-onnx-2024-05-22-2.tar.gz")
8+
set(openfst_HASH "SHA256=ec52d32ab46ac884d77c87918155ca9d0cae424095ce3bd7e3cc7eaab8235a39")
99

1010
# If you don't have access to the Internet,
1111
# please pre-download it
1212
set(possible_file_locations
13-
$ENV{HOME}/Downloads/openfst-sherpa-onnx-2024-04-09.tar.gz
14-
${CMAKE_SOURCE_DIR}/openfst-sherpa-onnx-2024-04-09.tar.gz
15-
${CMAKE_BINARY_DIR}/openfst-sherpa-onnx-2024-04-09.tar.gz
16-
/tmp/openfst-sherpa-onnx-2024-04-09.tar.gz
17-
/star-fj/fangjun/download/github/openfst-sherpa-onnx-2024-04-09.tar.gz
13+
$ENV{HOME}/Downloads/openfst-sherpa-onnx-2024-05-22-2.tar.gz
14+
${CMAKE_SOURCE_DIR}/openfst-sherpa-onnx-2024-05-22-2.tar.gz
15+
${CMAKE_BINARY_DIR}/openfst-sherpa-onnx-2024-05-22-2.tar.gz
16+
/tmp/openfst-sherpa-onnx-2024-05-22-2.tar.gz
17+
/star-fj/fangjun/download/github/openfst-sherpa-onnx-2024-05-22-2.tar.gz
1818
)
1919

2020
foreach(f IN LISTS possible_file_locations)

scripts/dotnet/generate.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def process_linux(s):
4343
"libpiper_phonemize.so.1",
4444
"libsherpa-onnx-c-api.so",
4545
"libsherpa-onnx-core.so",
46-
"libsherpa-onnx-fstfar.so.7",
47-
"libsherpa-onnx-fst.so.6",
46+
"libsherpa-onnx-fstfar.so",
47+
"libsherpa-onnx-fst.so",
4848
"libsherpa-onnx-kaldifst-core.so",
4949
"libucd.so",
5050
]
@@ -72,8 +72,8 @@ def process_macos(s):
7272
"libpiper_phonemize.1.dylib",
7373
"libsherpa-onnx-c-api.dylib",
7474
"libsherpa-onnx-core.dylib",
75-
"libsherpa-onnx-fstfar.7.dylib",
76-
"libsherpa-onnx-fst.6.dylib",
75+
"libsherpa-onnx-fstfar.dylib",
76+
"libsherpa-onnx-fst.dylib",
7777
"libsherpa-onnx-kaldifst-core.dylib",
7878
"libucd.dylib",
7979
]

scripts/dotnet/run.sh

-4
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ if [ ! -f $src_dir/linux/libsherpa-onnx-core.so ]; then
5353
cp -v sherpa_onnx/lib/*.so* ../
5454
cd ..
5555
rm -v libpiper_phonemize.so libpiper_phonemize.so.1.2.0
56-
rm -v libsherpa-onnx-fst.so
57-
rm -v libsherpa-onnx-fstfar.so
5856
rm -v libonnxruntime.so
5957
rm -v libcargs.so
6058
rm -rf wheel
@@ -80,8 +78,6 @@ if [ ! -f $src_dir/macos/libsherpa-onnx-core.dylib ]; then
8078
rm -v libcargs.dylib
8179
rm -v libonnxruntime.dylib
8280
rm -v libpiper_phonemize.1.2.0.dylib libpiper_phonemize.dylib
83-
rm -v libsherpa-onnx-fst.dylib
84-
rm -v libsherpa-onnx-fstfar.dylib
8581
rm -rf wheel
8682
ls -lh
8783
cd ..

sherpa-onnx/python/tests/test_speaker_recognition.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def test_wespeaker_models(self):
194194
test_zh_models(filename)
195195
test_en_and_zh_models(filename)
196196

197-
def test_3dpeaker_models(self):
197+
def _test_3dpeaker_models(self):
198198
model_dir = Path(d) / "3dspeaker"
199199
if not model_dir.is_dir():
200200
print(f"{model_dir} does not exist - skip it")

wasm/asr/sherpa-onnx-asr.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ function initSherpaOnnxOfflineWhisperModelConfig(config, Module) {
425425
const n = encoderLen + decoderLen + languageLen + taskLen;
426426
const buffer = Module._malloc(n);
427427

428-
const len = 4 * 4; // 4 pointers
428+
const len = 5 * 4; // 4 pointers
429429
const ptr = Module._malloc(len);
430430

431431
let offset = 0;

wasm/tts/sherpa-onnx-tts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function initSherpaOnnxOfflineTtsVitsModelConfig(config, Module) {
2727

2828
const buffer = Module._malloc(n);
2929

30-
const len = 7 * 4;
30+
const len = 8 * 4;
3131
const ptr = Module._malloc(len);
3232

3333
let offset = 0;

0 commit comments

Comments
 (0)