Skip to main content

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 单次推理最大音频时长;更长音频会被自动切块

依赖

  • fasr
  • torch >= 2.0.0
  • kaldiio >= 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.1.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fasr_lid_firered-0.5.1-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file fasr_lid_firered-0.5.1.tar.gz.

File metadata

  • Download URL: fasr_lid_firered-0.5.1.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

Hashes for fasr_lid_firered-0.5.1.tar.gz
Algorithm Hash digest
SHA256 cf250da165a711e14349f98cf30e81290fba599125b2fd42bc22d97cc680fed5
MD5 8c55c8a60c41e2e69b1d36f4d6d5ea9d
BLAKE2b-256 63275710556236a88fc5e112bdf42e9809f1b6e8a9efb9954382a90a992531cf

See more details on using hashes here.

File details

Details for the file fasr_lid_firered-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: fasr_lid_firered-0.5.1-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

Hashes for fasr_lid_firered-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae370e8c2c88715acccc00675cbedb12959e646f2df00f345bfbaa3ab5dbc1f9
MD5 be26aa03ca6745d99b2159b9d608fd5c
BLAKE2b-256 b901e06e24ceeaf9ca9298f3a67fc279ecf96eb8393d1e5ff6f223cf88c9eb2b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page