Skip to main content

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.0 或 30.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

Metadata

Release files for fasr-lid-firered 0.5.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fasr-lid-firered 0.5.8
File Size Uploaded
fasr_lid_firered-0.5.8.tar.gz 13.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fasr-lid-firered 0.5.8
File Interpreter ABI Platform
fasr_lid_firered-0.5.8-py3-none-any.whl Python 3 none any Details

Total release size: 33.4 kB

Release files / fasr_lid_firered-0.5.8.tar.gz

Download URL fasr_lid_firered-0.5.8.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2cdf409974027060b3dfe1d55736f08477eff323676290b0094db97c9f4294e3
BLAKE2b-256 checksum
How to use checksums
4e25c33492cb99f07bdca0117bc9931403e258674f01a33688c71b4996133e3e
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / fasr_lid_firered-0.5.8-py3-none-any.whl

Download URL fasr_lid_firered-0.5.8-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
287aca325aff0f7f7086920cf33734dae55048b56796a906f57ee4648aa68261
BLAKE2b-256 checksum
How to use checksums
a24a9e67c0f415d8b9d8385d1690639c71af9e16125a10e8b19cde403d13222a
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.5.8 This release

2 release files

0.5.7

1 release file

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.9

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page