FireRedLID language identification model for fasr
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fasr_lid_firered-0.5.7-py3-none-any.whl.
File metadata
- Download URL: fasr_lid_firered-0.5.7-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
350e746054ab67a23419a7dba7572147bfc7fb93edce6815f58f2627d2c69a96
|
|
| MD5 |
9dbdb5dff669ebed9fa1891d0d601346
|
|
| BLAKE2b-256 |
58f216377a604a32e60b6b8fa12fb149007ed4a3bf73d2e0e922ead1ad6553a4
|