fasr-asr-fun
基于 fun_asr_nano.py 的 funasr.AutoModel 推理方式封装,为 fasr 提供 Fun-ASR-Nano 无时间戳识别能力。
安装
pip install fasr-asr-fun
注册模型
| 注册名 | 类 | 默认 checkpoint | 说明 |
|---|---|---|---|
fun_asr_nano |
FunASRNanoForASR |
FunAudioLLM/Fun-ASR-Nano-2512 |
Fun-ASR-Nano,无时间戳输出 |
使用方式
from fasr import AudioPipeline
pipeline = (
AudioPipeline()
.add_pipe("detector", model="fsmn")
.add_pipe("recognizer", model="fun_asr_nano")
.add_pipe("sentencizer", model="ct_transformer")
)
单独使用模型
模型实例化时会自动执行 download_checkpoint() + load_checkpoint():
from fasr.config import registry
model = registry.asr_models.get("fun_asr_nano")(device="cuda:0")
# or model.load_checkpoint("/path/to/custom/fun_asr")
运行期 / 会话参数
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
checkpoint |
str | None |
"FunAudioLLM/Fun-ASR-Nano-2512" |
远程 repo_id;非空时实例化会自动下载 |
cache_dir |
str | Path | None |
None |
缓存目录,None 使用 fasr.utils.get_cache_dir() |
endpoint |
Literal["modelscope", "huggingface", "hf-mirror"] |
"modelscope" |
下载端点 |
device |
str |
"cuda:0" |
推理设备 |
trust_remote_code |
bool |
True |
是否信任远程代码 |
language |
str |
"中文" |
默认识别语言 |
itn |
bool |
True |
是否执行逆文本规范化 |
batch_size |
int |
1 |
generate 批大小 |
transcribe 支持通过 kwargs 覆盖 hotwords、language、itn、batch_size。
输出说明
- 当前模型不返回词级/字级时间戳。
- fasr 中会把整段识别文本作为一个
AudioToken返回。
Metadata
Release files for fasr-asr-fun 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fasr_asr_fun-0.5.1.tar.gz | 4.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fasr_asr_fun-0.5.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.9 kB
Release files / fasr_asr_fun-0.5.1.tar.gz
| Download URL | fasr_asr_fun-0.5.1.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8234660671b6652b5d2cb13658cd77ba10cbea0d71a34802f388583758407243
|
|
BLAKE2b-256 checksum How to use checksums |
7cc54022410065d56dded6f0c45b7751a036b072c96822c1756dd4d5f78faac6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / fasr_asr_fun-0.5.1-py3-none-any.whl
| Download URL | fasr_asr_fun-0.5.1-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d5e66ddfde3ed6b5d608f204517b298afdae8ddc87bd33335d8abf9ce4fe72f
|
|
BLAKE2b-256 checksum How to use checksums |
08f02a2b3c418c12ca28637dae89a34de8cea8e5cb569c3efe17c3de97cc85c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|