|
Download README.md from HY-2012/FireRedPunc.AXERA: direct link, hf CLI and curl.
- Browser
- Download file 1.92 kB
-
https://huggingface.co/HY-2012/FireRedPunc.AXERA/resolve/main/README.md
- Command line
-
hf download hf://HY-2012/FireRedPunc.AXERA/README.md
-
curl -L -o README.md https://huggingface.co/HY-2012/FireRedPunc.AXERA/resolve/main/README.md
1.92 kB
| license: apache-2.0 | |
| language: | |
| - zh | |
| - en | |
| pipeline_tag: token-classification | |
| tags: | |
| - punctuation-restoration | |
| - fireredpunc | |
| - axera | |
| - ax650 | |
| # FireRedPunc.AXERA | |
| FireRedPunc 中英标点恢复模型的 AX650N 量化部署包。 | |
| - 模型:`chinese-lert-base`(BERT-base,12 层,768 hidden) | |
| - 输入:`[CLS] + tokens`,`input_ids [1,128] int32`,`attention_mask [1,128] float32` | |
| - 输出:`logits [1,127,5]`,标签 `space / , / 。 / ? / !` | |
| - 量化:Pulsar2 7.0,U16 激活 + S8 权重,Gather FP32 | |
| - AXMODEL:151.5 MiB | |
| ## 目录 | |
| ``` | |
| ├── config.json | |
| ├── models/ # punc.axmodel + tokenizer/vocab/out_dict | |
| ├── bin/ # fireredpunc_ax650 (aarch64) | |
| ├── python/ # punc_ax.py | |
| └── run_ax650.sh | |
| ``` | |
| ## C++ 运行 | |
| ```bash | |
| export LD_LIBRARY_PATH=/soc/lib:${LD_LIBRARY_PATH:-} | |
| ./run_ax650.sh --text "今天天气很好我们去公园散步吧" | |
| ``` | |
| 输出: | |
| ``` | |
| IN : 今天天气很好我们去公园散步吧 | |
| OUT: 今天天气很好,我们去公园散步吧。 | |
| ``` | |
| ## Python 运行 | |
| ```bash | |
| pip3 install numpy transformers | |
| # pip3 install axengine-<version>-py3-none-any.whl | |
| ./run_ax650.sh python --text "今天天气很好我们去公园散步吧" | |
| ``` | |
| ## 指标(AX650N) | |
| | 项 | 结果 | | |
| |---|---| | |
| | AXMODEL vs fp32 ONNX | 272 行 / 4523 token,100% | | |
| | C++ vs Python | 272/272 text exact | | |
| | 标点 F1(排除句末) | 0.9937 | | |
| | Python 延迟 | median 23.2–23.5 ms | | |
| | C++ 延迟 | median 21.1 ms | | |
| | 等效 RTF(按 10 s VAD 段) | Python 0.0023 / C++ 0.0021 | | |
| Punc 是文本模型,延迟按句基本固定;RTF 以每个 10 s 语音段折算。 | |
| ## 源码 | |
| 模型转换、C++ 源码和评测: | |
| [ZY-2012/FireRedPunc.AXERA](https://github.com/ZY-2012/FireRedPunc.AXERA) | |
| ## 参考 | |
| - [FireRedPunc](https://huggingface.co/FireRedTeam/FireRedPunc) | |
| - [Magnetar](https://github.com/AXERA-TECH/Magnetar) | |
| ## License | |
| Apache-2.0。 | |