model : add LiquidAI/LFM3-Audio-2B and LiquidAI/LFM3-Omni-2B (#31257)

* model : add LiquidAI/LFM3-Audio-2B and LiquidAI/LFM3-Omni-2B

Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
Assisted-by: Claude Opus 5.5

* convert : read the LFM3-Audio config.json as released

A transformers that knows lfm3_audio rewrites the config into another layout (no lfm/encoder keys).

Assisted-by: Claude Opus 5.5

* mtmd : disable flash attention for the LFM3-Audio depthformer

Assisted-by: Claude Opus 5.5

* tts : add a voice option for LFM3-Audio and LFM3-Omni

The model card offers a female and a male voice; --tts-voice for llama-tts, "voice" for the server /tts.

Assisted-by: Claude Opus 5.5

* clean up template handling

* convert : detect LFM3-Audio and LFM3-Omni by model_type

Assisted-by: Claude Opus 5.5

* move banned tokens --> logits bias --> mtmd_helper

* leave mtmd-cli unchanged

* no more template_asr_system

* left over

* llama : keep the LFM3-Audio encoder convs and codec unquantized

Assisted-by: Claude Opus 5.5

* common, mtmd : shorten comments

Assisted-by: Claude Opus 5.5

---------

Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
This commit is contained in:
Tarek DakhranandXuan Son Nguyen authored and GitHub committed 2026-10-27 18:47:14 +01:00
1 parent eb7818c0b8
commit 19ff817fb2
31 files changed
+2727 -166

No files matched your search

+6 -2
View File
@@ -120,7 +120,8 @@ struct mtmd_cli_context {
init_vision_context(params);
mtmd_cap = mtmd_helper_get_capabilities(model, ctx_vision.get());
if (!mtmd_cap.chat) {
// a realtime transcription model has no chat, it streams the audio below
if (!mtmd_cap.chat && !mtmd_cap.audio_stream) {
LOG_ERR("Model does not support chat mode\n");
LOG_ERR("Hint: for TTS models, please use llama-tts\n");
exit(1);
@@ -567,7 +568,10 @@ int main(int argc, char ** argv) {
if (g_is_interrupted) return 130;
if (ctx.mtmd_cap.audio_stream) {
// realtime transcription models (no chat) transcribe while they listen, the others answer after the audio
const bool transcribes = ctx.mtmd_cap.audio_stream && !ctx.mtmd_cap.chat;
if (transcribes) {
if (params.image.size() != 1) {
LOG_ERR("This model transcribes audio in realtime, pass exactly one --audio file\n");
return 1;