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.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Update __init__.py
Daniel Hanf656a4bf75aa
diff --git a/unsloth/__init__.py b/unsloth/__init__.pyindex 72d53f572ef..a0ca276cde3 100644--- a/unsloth/__init__.py+++ b/unsloth/__init__.py@@ -20,6 +20,10 @@ import numpy as np# Log Unsloth is being usedos.environ["UNSLOTH_IS_PRESENT"] = "1"+# Check if modules that need patching are already imported+critical_modules = ["trl", "transformers", "peft"]+already_imported = [mod for mod in critical_modules if mod in sys.modules]+# Fix some issues before importing other packagesfrom .import_fixes import (fix_message_factory_issue,@@ -34,10 +38,6 @@ del fix_message_factory_issuedel check_fbgemm_gpu_versiondel torchvision_compatibility_check-# Check if modules that need patching are already imported-critical_modules = ["trl", "transformers", "peft"]-already_imported = [mod for mod in critical_modules if mod in sys.modules]-# This check is critical because Unsloth optimizes these libraries by modifying# their code at import time. If they're imported first, the original (slower,# more memory-intensive) implementations will be used instead of Unsloth's