From cb9f5bb923e1b7c63a8faa880dc3565535497c74 Mon Sep 17 00:00:00 2001 From: Mehmet Oguz Derin Date: Mon, 30 Jun 2025 02:14:02 +0300 Subject: [PATCH] Fix LoftQ with FastBaseModel (#2826) Pass `init_lora_weights` and `loftq_config` to `LoraConfig` constructor, which enables classes like `FastModel` to use LoftQ support. Thank you very much in advance! --- unsloth/models/vision.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index 8dca483783..3137792dac 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -594,13 +594,15 @@ class FastBaseModel: pass max_seq_length = model.max_seq_length lora_config = LoraConfig( - r = r, - lora_alpha = lora_alpha, - target_modules = target_modules, - lora_dropout = lora_dropout, - bias = bias, - task_type = task_type, - use_rslora = use_rslora, + r = r, + lora_alpha = lora_alpha, + target_modules = target_modules, + lora_dropout = lora_dropout, + bias = bias, + task_type = task_type, + use_rslora = use_rslora, + init_lora_weights = init_lora_weights, + loftq_config = loftq_config, ) model = prepare_model_for_kbit_training( model,