Skip to main content

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.030.0
GPU 显存紧张 设置 use_half=True
CPU-only 部署 设置 use_gpu=False

依赖

  • fasr
  • torch >= 2.0.0
  • numpy >= 1.24
  • kaldiio >= 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.8.tar.gz (13.2 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.8-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

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

Hashes for fasr_lid_firered-0.5.8.tar.gz
Algorithm Hash digest
SHA256 2cdf409974027060b3dfe1d55736f08477eff323676290b0094db97c9f4294e3
MD5 602cb8343a54455e4425f36347cea057
BLAKE2b-256 4e25c33492cb99f07bdca0117bc9931403e258674f01a33688c71b4996133e3e

See more details on using hashes here.

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

Hashes for fasr_lid_firered-0.5.8-py3-none-any.whl
Algorithm Hash digest
SHA256 287aca325aff0f7f7086920cf33734dae55048b56796a906f57ee4648aa68261
MD5 d80557e0a42c68d992921a318481bc5c
BLAKE2b-256 a24a9e67c0f415d8b9d8385d1690639c71af9e16125a10e8b19cde403d13222a

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