From c823e52b2d9a308443e78795002e08b887f9b837 Mon Sep 17 00:00:00 2001 From: majiayu000 <1835304752@qq.com> Date: Mon, 29 Dec 2025 19:07:51 +0800 Subject: [PATCH] fix: propagate revision parameter to vLLM and PEFT loaders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add revision to load_vllm_kwargs in llama.py to fix config/weights mismatch - Add revision to PEFT AutoConfig calls in loader.py (FastLanguageModel & FastModel) Addresses reviewer feedback from @chatgpt-codex-connector and @Datta0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 (cherry picked from commit 14f89e453173f3279c885ed37d5f2a9cf10793df) --- unsloth/models/llama.py | 1 + unsloth/models/loader.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 0498c11734..fd2b3044c0 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -2471,6 +2471,7 @@ class FastLlamaModel: disable_log_stats = disable_log_stats, use_bitsandbytes = load_in_4bit, unsloth_vllm_standby = unsloth_vllm_standby, + revision = revision, fp8_mode = fp8_mode, ) for allowed_arg in allowed_args: diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index bd15ed5281..3155cd0d09 100644 --- a/unsloth/models/loader.py +++ b/unsloth/models/loader.py @@ -553,6 +553,7 @@ class FastLanguageModel(FastLlamaModel): model_config = AutoConfig.from_pretrained( model_name, token = token, + revision = revision, trust_remote_code = trust_remote_code, ) @@ -1304,6 +1305,7 @@ class FastModel(FastBaseModel): model_config = AutoConfig.from_pretrained( model_name, token = token, + revision = revision, trust_remote_code = trust_remote_code, )