FireRedLID language identification model for fasr
Project description
fasr-lid-firered
基于 FireRedLID 的语种识别模型插件,为 fasr 提供音频语种自动识别能力。
安装
pip install fasr-lid-firered
注册模型
| 注册名 | 类 | 默认 checkpoint | 说明 |
|---|---|---|---|
firered |
FireRedForLID |
xukaituo/FireRedLID |
语种识别,返回语言标识(如 "zh"、"en") |
模型权重默认从 ModelScope 自动下载。
使用方式
单独使用模型
模型实例化时会自动执行 download_checkpoint() + load_checkpoint():
from fasr.config import registry
from fasr.data import Waveform
model = registry.lid_models.get("firered")(use_gpu=True, use_half=True)
waveform = Waveform.from_file("example.wav")
lang = model.identify(waveform)
print(lang) # e.g. "zh"
# 使用自定义权重目录
model.load_checkpoint("/path/to/custom/firered-lid")
运行期 / 会话参数
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
checkpoint |
str | None |
"FireRedTeam/FireRedLID" |
远程 repo_id;非空时实例化会自动下载 |
cache_dir |
str | Path | None |
None |
缓存目录,None 使用 fasr.utils.get_cache_dir() |
endpoint |
Literal["modelscope", "huggingface", "hf-mirror"] |
"modelscope" |
下载端点 |
use_gpu |
bool |
True |
是否使用 GPU 推理 |
use_half |
bool |
False |
是否使用 FP16 推理加速 |
max_chunk_seconds |
float |
60.0 |
单次推理最大音频时长;更长音频会被自动切块 |
依赖
fasrtorch >= 2.0.0kaldiio >= 2.18.0、kaldi-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.0.tar.gz
(12.9 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.0.tar.gz.
File metadata
- Download URL: fasr_lid_firered-0.5.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca65a7460f7b8f2b54b05a9e60ab3d94bd4a1b6593fc2141d6af824137342726
|
|
| MD5 |
4ab7210ec44622cb26abd0216f24bfc1
|
|
| BLAKE2b-256 |
2c63dac22f43bd9131c029f1529ec70be8d546678d93b5865899fe93952ad3e7
|
File details
Details for the file fasr_lid_firered-0.5.0-py3-none-any.whl.
File metadata
- Download URL: fasr_lid_firered-0.5.0-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
419f56ace1a5123ecbf9a6ff0f32956e788ea5c08afccc41713f825e96d18654
|
|
| MD5 |
cb6fd58855fa90764aa0c6659e5ad909
|
|
| BLAKE2b-256 |
0b723eea9c94503b2d3026e257d434b01960f65651afe92a4cd9533024bf7aa0
|