fasr-asr-qwen3
内置 Qwen3-ASR 推理(Transformers / vLLM)的语音识别模型插件,为 fasr 提供无时间戳 ASR 能力。
安装
pip install fasr-asr-qwen3
注册模型
| 注册名 | 类 | 默认 checkpoint | 说明 |
|---|---|---|---|
qwen3_0_6b |
Qwen3_06BForASR |
Qwen/Qwen3-ASR-0.6B |
离线 ASR,当前不返回时间戳 |
qwen3_1_7b |
Qwen3_17BForASR |
Qwen/Qwen3-ASR-1.7B |
离线 ASR,当前不返回时间戳 |
stream_qwen3_0_6b |
Qwen3_06BForStreamASR |
Qwen/Qwen3-ASR-0.6B |
流式 ASR(vLLM 后端),每 chunk_size_ms 重新解码一次 |
stream_qwen3_1_7b |
Qwen3_17BForStreamASR |
Qwen/Qwen3-ASR-1.7B |
流式 ASR(vLLM 后端),每 chunk_size_ms 重新解码一次 |
使用方式
from fasr import AudioPipeline
pipeline = (
AudioPipeline()
.add_pipe("detector", model="fsmn")
.add_pipe("recognizer", model="qwen3_1.7b") # 或 qwen3_0.6b
.add_pipe("sentencizer", model="ct_transformer")
)
单独使用模型
模型实例化时会自动执行 download_checkpoint() + load_checkpoint():
from fasr.config import registry
model = registry.asr_models.get("qwen3_1.7b")(gpu_memory_utilization=0.6)
# or model.load_checkpoint("/path/to/custom/qwen3")
运行期 / 会话参数
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
checkpoint |
str | None |
子类各自默认 | 远程 repo_id;非空时实例化会自动下载到 cache_dir |
cache_dir |
str | Path | None |
None |
缓存目录,None 使用 fasr.utils.get_cache_dir() |
endpoint |
Literal["modelscope", "huggingface", "hf-mirror"] |
"modelscope" |
下载端点 |
max_new_tokens |
int |
4096 |
最大生成 token 数 |
max_inference_batch_size |
int |
-1 |
vLLM 推理批次上限,-1 不限制 |
gpu_memory_utilization |
float |
0.8 |
vLLM 可占用的 GPU 显存比例,(0, 1] |
max_model_len |
int | None |
None |
vLLM max_model_len;None 回退为 max_new_tokens * 2 |
流式使用(StreamASR)
stream_qwen3_* 实现了 ASRModel.push_chunk,接在流式 VAD 之后即可:
from fasr.config import registry
model = registry.stream_asr_models.get("stream_qwen3_0_6b")(
chunk_size_ms=2000,
language="zh", # 可选:强制语种
)
for chunk in audio_chunk_stream:
span = model.push_chunk(chunk)
if span is not None:
print(span.text, flush=True)
注意:Qwen3-ASR 流式本质是“累计音频重解码”,每个 chunk 返回的是 当前累计结果(
AudioSpan.raw_text)。后续 chunk 可能会改写前文, 所以上层消费应采用“覆盖显示最新文本”,而不是拼接增量 delta。
输出说明
- 当前模型不返回词级/字级时间戳。
- 离线模式把整段识别文本写入
span.raw_text(span.text即可访问); 流式模式每个 chunk 都返回当前累计文本(AudioSpan(raw_text=...)), 最后一个 chunk 的返回带is_last=True。
Metadata
Release files for fasr-asr-qwen3 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 | Provenance | Actions |
|---|---|---|---|---|
| fasr_asr_qwen3-0.5.1.tar.gz | 117.3 kB | Without provenance | Details for fasr_asr_qwen3-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fasr_asr_qwen3-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for fasr_asr_qwen3-0.5.1-py3-none-any.whl |
Total release size: 237.0 kB
Release files / fasr_asr_qwen3-0.5.1.tar.gz
| Download URL | fasr_asr_qwen3-0.5.1.tar.gz |
|---|---|
| Size | 117.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
928bfbb3ff546109b1ed84ea9a121cc5eca95b46c8b741de84451dcd2064e012
|
|
BLAKE2b-256 checksum How to use checksums |
d075103b8b5913d8d2feb73b2421996ac4f1a32bc198bca9e03786d5fefa1782
|
| 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_qwen3-0.5.1-py3-none-any.whl
| Download URL | fasr_asr_qwen3-0.5.1-py3-none-any.whl |
|---|---|
| Size | 119.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a2fabd7bdd0576b25ebc349f5ca4111e67632394d0cdb6c0cee3c56b42ce19a
|
|
BLAKE2b-256 checksum How to use checksums |
80d907b2eb68493569d0328b7ac2aa7064272776204fcfc3b83ffc443bb9c7d9
|
| 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}
|
Security for fasr-asr-qwen3 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.