Skip to main content

FireRedLID language identification model for fasr

Project description

fasr-lid-firered

Chinese documentation

FireRedLID language identification for fasr. It accepts a Waveform and returns a language tag such as "zh" or "en".

Install

pip install fasr-lid-firered

Registered Model

Registry name Class Best for
firered FireRedForLID Audio language identification with FireRedLID

The default checkpoint is FireRedTeam/FireRedLID.

Direct Model Usage

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)

Use local weights:

model.load_checkpoint("/path/to/FireRedLID")

Confection Config

[lid_model]
@lid_models = "firered"
use_gpu = true
use_half = false
max_chunk_seconds = 60.0

Parameters

Parameter Type / range Default Higher / true Lower / false Change when
use_gpu bool True Uses CUDA when available Uses CPU You want predictable CPU deployment or faster GPU inference
use_half bool False Uses FP16 on GPU, lower VRAM Uses FP32, more stable GPU memory is tight, or FP16 causes instability
max_chunk_seconds float > 0 60.0 Fewer chunks, more memory per call More chunks, less memory per call Long audio causes OOM, or throughput needs tuning

Generic checkpoint fields such as checkpoint, cache_dir, endpoint, revision, and force_download are inherited from the base model.

Tuning Guide

Symptom Try first
GPU out of memory on long audio Lower max_chunk_seconds to 20.0 or 30.0
GPU memory is tight Set use_half=True
CPU-only deployment Set use_gpu=False
Language result is unstable on very long audio Keep chunking enabled and aggregate over multiple chunks, the model already votes internally

Dependencies

  • 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.3.tar.gz (12.8 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.3-py3-none-any.whl (19.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fasr_lid_firered-0.5.3.tar.gz
  • Upload date:
  • Size: 12.8 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.3.tar.gz
Algorithm Hash digest
SHA256 0a80422fea7530b4e5533b87049dbbe0cf87d76749e6a1f109d4cd4c57d42aa9
MD5 51f2e24a619f6237fd198d0ce10d9101
BLAKE2b-256 bed405149f6d2ac976a8d9a53779ed47f0bd9bcdd807ddb20c2e7ef29aeb25d5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasr_lid_firered-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 19.9 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 815842601b95ee780e03173182f5482c8d1122229ebc3d9997d30575389d6b28
MD5 ee2ea7f4d33a7072c4e6ee06731632a9
BLAKE2b-256 9d316c1f56f526aea0e43676caad565a5a6381967e2c28b32a7a9403d3f45c46

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