From 88dd06edbfc26b02a8c157b913a701333c6aa2d4 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 19 Mar 2025 04:30:06 -0700 Subject: [PATCH] Update vision.py --- unsloth/models/vision.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index 38297c7667..1f2d99d2ac 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -172,14 +172,14 @@ def unsloth_base_fast_generate( state_dict = convert_lora_modules(self, dtype = dtype) # Set compile dynamic shapes - torch._dynamo.mark_static(input_ids, 0) - torch._dynamo.mark_dynamic(input_ids, 1) - if "attention_mask" in kwargs: - torch._dynamo.mark_static(kwargs["attention_mask"], 0) - torch._dynamo.mark_dynamic(kwargs["attention_mask"], 1) - if "token_type_ids" in kwargs: - torch._dynamo.mark_static(kwargs["token_type_ids"], 0) - torch._dynamo.mark_dynamic(kwargs["token_type_ids"], 1) + # torch._dynamo.mark_static(input_ids, 0) + # torch._dynamo.mark_dynamic(input_ids, 1) + # if "attention_mask" in kwargs: + # torch._dynamo.mark_static(kwargs["attention_mask"], 0) + # torch._dynamo.mark_dynamic(kwargs["attention_mask"], 1) + # if "token_type_ids" in kwargs: + # torch._dynamo.mark_static(kwargs["token_type_ids"], 0) + # torch._dynamo.mark_dynamic(kwargs["token_type_ids"], 1) # Fix generation_config # Use hybrid if sliding window seen, otherwise try static