From 5c016f57ca15217ea641a69fcec094cb4bc55793 Mon Sep 17 00:00:00 2001 From: Erland366 Date: Wed, 28 Jan 2026 20:55:43 +0000 Subject: [PATCH] Fix missing RotaryEmbeddingConfigMixin --- unsloth/models/_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 0f83fe458d..4d0a222267 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -535,6 +535,12 @@ try: from transformers.configuration_utils import layer_type_validation except: pass + +try: + # Transformers 5.0+ uses RotaryEmbeddingConfigMixin as a base class for configs + from transformers.modeling_rope_utils import RotaryEmbeddingConfigMixin +except: + pass from transformers import __version__ as transformers_version try: