From cb86342cab8723c7e004d00a9421b47244eaa4b5 Mon Sep 17 00:00:00 2001 From: Ole Valente Date: Sat, 11 Jul 2026 00:12:44 +0200 Subject: [PATCH] Monkey-patch LLAMA_ATTENTION_CLASSES for boson_multimodal compatibility with transformers 5.x --- backend/app/services/stt.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/app/services/stt.py b/backend/app/services/stt.py index 37be580..952de86 100644 --- a/backend/app/services/stt.py +++ b/backend/app/services/stt.py @@ -13,6 +13,12 @@ from transformers import ( AutoTokenizer, WhisperProcessor, ) + +import transformers.models.llama.modeling_llama as _llama_mod + +if not hasattr(_llama_mod, "LLAMA_ATTENTION_CLASSES"): + _llama_mod.LLAMA_ATTENTION_CLASSES = _llama_mod.ALL_ATTENTION_FUNCTIONS + from boson_multimodal.data_collator.higgs_audio_collator import HiggsAudioSampleCollator from boson_multimodal.data_types import ChatMLSample, AudioContent, Message from boson_multimodal.dataset.chatml_dataset import (