Spaces:
Build error
Build error
Commit
·
f59be55
1
Parent(s):
fc7e843
add new zipformer
Browse files
model.py
CHANGED
|
@@ -26,7 +26,7 @@ os.system(
|
|
| 26 |
"cp -v /home/user/.local/lib/python3.8/site-packages/k2/lib/*.so /home/user/.local/lib/python3.8/site-packages/sherpa/lib/"
|
| 27 |
)
|
| 28 |
|
| 29 |
-
import k2
|
| 30 |
import sherpa
|
| 31 |
import sherpa_onnx
|
| 32 |
import numpy as np
|
|
@@ -317,6 +317,9 @@ def _get_english_model(
|
|
| 317 |
"csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13", # noqa
|
| 318 |
"csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless7-2022-11-11", # noqa
|
| 319 |
"csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless8-2022-11-14", # noqa
|
|
|
|
|
|
|
|
|
|
| 320 |
"videodanchik/icefall-asr-tedlium3-conformer-ctc2",
|
| 321 |
"pkufool/icefall_asr_librispeech_conformer_ctc",
|
| 322 |
"WayneWiser/icefall-asr-librispeech-conformer-ctc2-jit-bpe-500-2022-07-21",
|
|
@@ -347,6 +350,13 @@ def _get_english_model(
|
|
| 347 |
):
|
| 348 |
filename = "cpu_jit-epoch-20-avg-5.pt"
|
| 349 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 350 |
nn_model = _get_nn_model_filename(
|
| 351 |
repo_id=repo_id,
|
| 352 |
filename=filename,
|
|
@@ -836,6 +846,9 @@ english_models = {
|
|
| 836 |
"csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless8-2022-11-14": _get_english_model, # noqa
|
| 837 |
"csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless7-2022-11-11": _get_english_model, # noqa
|
| 838 |
"csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13": _get_english_model, # noqa
|
|
|
|
|
|
|
|
|
|
| 839 |
"videodanchik/icefall-asr-tedlium3-conformer-ctc2": _get_english_model,
|
| 840 |
"pkufool/icefall_asr_librispeech_conformer_ctc": _get_english_model,
|
| 841 |
"WayneWiser/icefall-asr-librispeech-conformer-ctc2-jit-bpe-500-2022-07-21": _get_english_model,
|
|
|
|
| 26 |
"cp -v /home/user/.local/lib/python3.8/site-packages/k2/lib/*.so /home/user/.local/lib/python3.8/site-packages/sherpa/lib/"
|
| 27 |
)
|
| 28 |
|
| 29 |
+
import k2 # noqa
|
| 30 |
import sherpa
|
| 31 |
import sherpa_onnx
|
| 32 |
import numpy as np
|
|
|
|
| 317 |
"csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13", # noqa
|
| 318 |
"csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless7-2022-11-11", # noqa
|
| 319 |
"csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless8-2022-11-14", # noqa
|
| 320 |
+
"Zengwei/icefall-asr-librispeech-zipformer-large-2023-05-16", # noqa
|
| 321 |
+
"Zengwei/icefall-asr-librispeech-zipformer-2023-05-15", # noqa
|
| 322 |
+
"Zengwei/icefall-asr-librispeech-zipformer-small-2023-05-16", # noqa
|
| 323 |
"videodanchik/icefall-asr-tedlium3-conformer-ctc2",
|
| 324 |
"pkufool/icefall_asr_librispeech_conformer_ctc",
|
| 325 |
"WayneWiser/icefall-asr-librispeech-conformer-ctc2-jit-bpe-500-2022-07-21",
|
|
|
|
| 350 |
):
|
| 351 |
filename = "cpu_jit-epoch-20-avg-5.pt"
|
| 352 |
|
| 353 |
+
if repo_id in (
|
| 354 |
+
"Zengwei/icefall-asr-librispeech-zipformer-large-2023-05-16",
|
| 355 |
+
"Zengwei/icefall-asr-librispeech-zipformer-2023-05-15",
|
| 356 |
+
"Zengwei/icefall-asr-librispeech-zipformer-small-2023-05-16",
|
| 357 |
+
):
|
| 358 |
+
filename = "jit_script.pt"
|
| 359 |
+
|
| 360 |
nn_model = _get_nn_model_filename(
|
| 361 |
repo_id=repo_id,
|
| 362 |
filename=filename,
|
|
|
|
| 846 |
"csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless8-2022-11-14": _get_english_model, # noqa
|
| 847 |
"csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless7-2022-11-11": _get_english_model, # noqa
|
| 848 |
"csukuangfj/icefall-asr-librispeech-pruned-transducer-stateless3-2022-05-13": _get_english_model, # noqa
|
| 849 |
+
"Zengwei/icefall-asr-librispeech-zipformer-large-2023-05-16": _get_english_model, # noqa
|
| 850 |
+
"Zengwei/icefall-asr-librispeech-zipformer-2023-05-15": _get_english_model, # noqa
|
| 851 |
+
"Zengwei/icefall-asr-librispeech-zipformer-small-2023-05-16": _get_english_model, # noqa
|
| 852 |
"videodanchik/icefall-asr-tedlium3-conformer-ctc2": _get_english_model,
|
| 853 |
"pkufool/icefall_asr_librispeech_conformer_ctc": _get_english_model,
|
| 854 |
"WayneWiser/icefall-asr-librispeech-conformer-ctc2-jit-bpe-500-2022-07-21": _get_english_model,
|