Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Update _utils.py

Daniel Handfb936743d1e
diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py
index fd4cd81d83c..85f1a9a9604 100644
--- a/unsloth/models/_utils.py
+++ b/unsloth/models/_utils.py
@@ -273,6 +273,18 @@ try:
except:
pass
+# UserWarning: Logical operators 'and' and 'or' are deprecated for non-scalar tensors; please use '&' or '|' instead
+# Will be fixed in torch 2.8.1 https://github.com/pytorch/pytorch/issues/158463
+try:
+ warnings.filterwarnings(
+ action = "ignore",
+ message = r".*Logical operators 'and' and 'or'.*",
+ category = UserWarning,
+ append = True,
+ )
+except:
+ pass
+
# Using a slow image processor as `use_fast`
try:
from transformers.processing_utils import logger as processing_utils_logger