From 84ef3b6a8ffda2d996fcb1edd3a84794185b9436 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 17 Jul 2025 01:40:49 -0700 Subject: [PATCH] compiler stance --- unsloth/models/vision.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index 72371f9332..5bbf4c76a6 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -755,8 +755,8 @@ class FastBaseModel: os.environ["UNSLOTH_RETURN_HIDDEN_STATES"] = "0" # Must enable returning logits os.environ["UNSLOTH_RETURN_LOGITS"] = "1" - # Turn off skip guards - torch.compiler.set_stance(skip_guard_eval_unsafe = False) + # Turn off skip guards and set stance to default + torch.compiler.set_stance(stance = "default", skip_guard_eval_unsafe = False) return model pass @@ -803,6 +803,8 @@ class FastBaseModel: pass # Can re-enable not returning logits os.environ["UNSLOTH_RETURN_LOGITS"] = "0" + # Turn off skip guards and set stance to default + torch.compiler.set_stance(stance = "default", skip_guard_eval_unsafe = False) return model pass pass