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.4.0.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.4.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fasr_lid_firered-0.4.0.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.4.0.tar.gz
Algorithm Hash digest
SHA256 583321de5926c687363b0ddaf2fc531d945cd4aadcb24b2dcb7feeeaa9264aaf
MD5 9bde67573dcea1c43a691bfb45f096f1
BLAKE2b-256 afee63fcbca075ce3d994782030711b8eb2b4560978443a58fd2f0ab60b1b2e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasr_lid_firered-0.4.0-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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7672e417bee303544f44887728aa9441f0ef65b92fe0dfb69a54772a3e49ff3
MD5 7b8cd50a5eabf11741a3b1a4d945242f
BLAKE2b-256 08209ac577c1cbe7fe311638f79b262411585358a8229aa6e6e20fae2b63ba91

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