fasr-lid-firered
英文文档地址: README_EN.md
FireRedLID 语种识别插件。输入 Waveform,返回 "zh"、"en" 等语言标签。
安装
pip install fasr-lid-firered
注册模型
| 注册名 | 类 | 适用场景 |
|---|---|---|
firered |
FireRedForLID |
使用 FireRedLID 做音频语种识别 |
默认 checkpoint 是 FireRedTeam/FireRedLID。
单独使用
from fasr.config import registry
from fasr.data import Waveform
model = registry.lid_models.get("firered")(
use_gpu=True,
use_half=True,
max_chunk_seconds=60.0,
)
waveform = Waveform.from_file("example.wav")
language = model.identify(waveform)
print(language)
Confection 配置
[lid_model]
@lid_models = "firered"
use_gpu = true
use_half = false
max_chunk_seconds = 60.0
参数
| 参数 | 类型 / 范围 | 默认值 | 调高 / 开启时 | 调低 / 关闭时 | 什么时候改 |
|---|---|---|---|---|---|
use_gpu |
bool |
True |
使用 CUDA | 使用 CPU | 需要 CPU 部署或 GPU 加速 |
use_half |
bool |
False |
GPU 上使用 FP16,显存更低 | 使用 FP32,更稳定 | 显存紧张或 FP16 不稳定 |
max_chunk_seconds |
float > 0 |
60.0 |
切块更少,单次内存更高 | 切块更多,单次内存更低 | 长音频 OOM 或吞吐调优 |
调参建议
| 现象 | 优先尝试 |
|---|---|
| 长音频 GPU OOM | 把 max_chunk_seconds 降到 20.0 或 30.0 |
| GPU 显存紧张 | 设置 use_half=True |
| CPU-only 部署 | 设置 use_gpu=False |
依赖
fasrtorch >= 2.0.0numpy >= 1.24kaldiio >= 2.18.0kaldi-native-fbank >= 1.19.0- Python 3.10-3.12
Metadata
Release files for fasr-lid-firered 0.5.8
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_lid_firered-0.5.8.tar.gz | 13.2 kB | Without provenance | Details for fasr_lid_firered-0.5.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fasr_lid_firered-0.5.8-py3-none-any.whl | Python 3 | none | any | Details for fasr_lid_firered-0.5.8-py3-none-any.whl |
Total release size: 33.4 kB
Release files / fasr_lid_firered-0.5.8.tar.gz
| Download URL | fasr_lid_firered-0.5.8.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2cdf409974027060b3dfe1d55736f08477eff323676290b0094db97c9f4294e3
|
|
BLAKE2b-256 checksum How to use checksums |
4e25c33492cb99f07bdca0117bc9931403e258674f01a33688c71b4996133e3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / fasr_lid_firered-0.5.8-py3-none-any.whl
| Download URL | fasr_lid_firered-0.5.8-py3-none-any.whl |
|---|---|
| Size | 20.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
287aca325aff0f7f7086920cf33734dae55048b56796a906f57ee4648aa68261
|
|
BLAKE2b-256 checksum How to use checksums |
a24a9e67c0f415d8b9d8385d1690639c71af9e16125a10e8b19cde403d13222a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for fasr-lid-firered 0.5.8
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.