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 自动下载。

使用方式

单独使用模型

from fasr.config import registry
from fasr.data import Waveform

model = registry.lid_models.get("firered")()
model.from_checkpoint(use_gpu=True, use_half=True)

waveform = Waveform.from_file("example.wav")
lang = model.identify(waveform)
print(lang)  # e.g. "zh"

from_checkpoint 参数

参数 类型 默认值 说明
checkpoint_dir str | Path | None None(自动下载) 模型权重目录
use_gpu bool True 是否使用 GPU 推理
use_half bool True 是否使用 FP16 推理加速

依赖

  • 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.3.9.tar.gz (12.4 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.3.9-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fasr_lid_firered-0.3.9.tar.gz
  • Upload date:
  • Size: 12.4 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.3.9.tar.gz
Algorithm Hash digest
SHA256 b9555f1871db54a7b8eccb3fb8ef96125265bc6429200ce77688a5ca74e2d2f0
MD5 5101436290cf056e28e5fcc023e39f64
BLAKE2b-256 4917d58ecace474387202517a215ec1d20e9517a717cadf83bdb24f67f23a230

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasr_lid_firered-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 19.6 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.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 4806419793a8ae59a7b6a306bbfcb8394f093ee06f8822c8c15d050ecb751b87
MD5 c55ee3165f276eab6215bd9175d95192
BLAKE2b-256 3600c2a42c4d9d2c5d16faa56cfbc6250edb8431e0b5e039dd790358cb0920bc

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