Fix decoder vocab size
Browse files
README.md
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
|
|
| 1 |
---
|
| 2 |
-
language:
|
| 3 |
- eu
|
|
|
|
| 4 |
license: apache-2.0
|
| 5 |
-
base_model:
|
| 6 |
-
- HiTZ/stt_eu_conformer_transducer_large
|
| 7 |
-
pipeline_tag: automatic-speech-recognition
|
| 8 |
---
|
| 9 |
|
| 10 |
# OVOS - STT Conformer Transducer Large ONNX (Basque)
|
|
@@ -44,6 +43,10 @@ model = nemo_asr.models.ASRModel.from_pretrained("HiTZ/stt_eu_conformer_transduc
|
|
| 44 |
|
| 45 |
onnx_dir = Path("onnx-dir")
|
| 46 |
onnx_dir.mkdir(exist_ok=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
model.export(str(Path(onnx_dir, "model.onnx")))
|
| 48 |
|
| 49 |
with Path(onnx_dir, "vocab.txt").open("wt") as f:
|
|
@@ -53,4 +56,5 @@ with Path(onnx_dir, "vocab.txt").open("wt") as f:
|
|
| 53 |
|
| 54 |
# Licensing
|
| 55 |
|
| 56 |
-
The license is derived from the original model: Apache 2.0. For more details, please refer to [HiTZ/stt_eu_conformer_transducer_large](https://huggingface.co/HiTZ/stt_eu_conformer_transducer_large).
|
|
|
|
|
|
| 1 |
+
|
| 2 |
---
|
| 3 |
+
language:
|
| 4 |
- eu
|
| 5 |
+
|
| 6 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
| 7 |
---
|
| 8 |
|
| 9 |
# OVOS - STT Conformer Transducer Large ONNX (Basque)
|
|
|
|
| 43 |
|
| 44 |
onnx_dir = Path("onnx-dir")
|
| 45 |
onnx_dir.mkdir(exist_ok=True)
|
| 46 |
+
|
| 47 |
+
if hasattr(model, "decoder") and hasattr(model.decoder, "vocab_size"):
|
| 48 |
+
model.decoder.vocab_size += 1 # to account for <blk>
|
| 49 |
+
|
| 50 |
model.export(str(Path(onnx_dir, "model.onnx")))
|
| 51 |
|
| 52 |
with Path(onnx_dir, "vocab.txt").open("wt") as f:
|
|
|
|
| 56 |
|
| 57 |
# Licensing
|
| 58 |
|
| 59 |
+
The license is derived from the original model: Apache 2.0. For more details, please refer to [HiTZ/stt_eu_conformer_transducer_large](https://huggingface.co/HiTZ/stt_eu_conformer_transducer_large).
|
| 60 |
+
|