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 Distribution
fasr_lid_firered-0.5.8.tar.gz
(13.2 kB
view details)
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.8.tar.gz.
File metadata
- Download URL: fasr_lid_firered-0.5.8.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cdf409974027060b3dfe1d55736f08477eff323676290b0094db97c9f4294e3
|
|
| MD5 |
602cb8343a54455e4425f36347cea057
|
|
| BLAKE2b-256 |
4e25c33492cb99f07bdca0117bc9931403e258674f01a33688c71b4996133e3e
|
File details
Details for the file fasr_lid_firered-0.5.8-py3-none-any.whl.
File metadata
- Download URL: fasr_lid_firered-0.5.8-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
287aca325aff0f7f7086920cf33734dae55048b56796a906f57ee4648aa68261
|
|
| MD5 |
d80557e0a42c68d992921a318481bc5c
|
|
| BLAKE2b-256 |
a24a9e67c0f415d8b9d8385d1690639c71af9e16125a10e8b19cde403d13222a
|