Instructions to use kadirnar/LFM2.5-Audio-1.5B-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kadirnar/LFM2.5-Audio-1.5B-hf with Transformers:
# Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("kadirnar/LFM2.5-Audio-1.5B-hf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
LFM2.5-Audio-1.5B โ Transformers conversion
Transformers-format conversion of LiquidAI/LFM2.5-Audio-1.5B, prepared for Transformers PR #48249. No additional training was performed. The original LICENSE is included.
This checkpoint includes the native model configuration and weights, LFM2-Audio feature extractor settings, multimodal chat template, tokenizer, and bundled audio detokenizer. Legacy module names and packed depth-attention QKV weights were converted for the native implementation.
Required Transformers implementation
The updated LFM2-Audio implementation is required. The review changes used for this conversion are currently local and have not been pushed to GitHub. Do not assume the released Transformers package or the current remote PR branch can load this checkpoint yet. Install the updated local Transformers checkout with pip install -e /path/to/transformers before using it. This repository does not provide remote Python code.
import torch
from transformers import AutoModelForMultimodalLM, AutoProcessor
model_id = "kadirnar/LFM2.5-Audio-1.5B-hf"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForMultimodalLM.from_pretrained(
model_id, dtype=torch.bfloat16,
).to("cuda").eval()
inputs = processor.apply_text_to_speech_request(
"Hello, how are you today?",
prompt="Perform TTS. Use the US male voice.",
).to(device=model.device, dtype=model.dtype)
output = model.generate(**inputs, max_new_tokens=128, text_top_k=1, audio_top_k=1)
waveform = processor.decode_audio(output.audio_codes)
# waveform: mono audio at processor.output_sampling_rate (24,000 Hz)
For ASR, pass a 16 kHz mono waveform to processor.apply_transcription_request(waveform, device=model.device), generate sequentially, and decode output.sequences with the tokenizer. Generation currently supports batch size one.
Validation and provenance
Six GPU integration scenarios passed: ASR, four TTS voices, and a 96-step interleaved generation prefix. Text tokens, all eight audio codebooks, and modality sequences matched the original Liquid Audio implementation exactly on an RTX 5070 Ti using PyTorch 2.8.0, BF16, and greedy decoding. Waveform checks also passed. This is a parity check, not a WER or speed benchmark.
- Original checkpoint revision:
c362a0625dfe45aa588dce5f0ada28a7e5707628. - Reference: Liquid Audio v1.3.0, commit
19e65845923a7f136442c95137884ec61eb386aa. - Shared Transformers LFM2 backbone: PR base commit
89a727319005f512aff3714c3838c8c37630b4fa, which does not contain native LFM2-Audio. The reference uses this revision to isolate audio integration changes from backbone changes between Transformers versions.
- Downloads last month
- 25