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.

Format the two files #11526 left off the formatter's fixed point (#11955)

Daniel Han0ff222f238e1
diff --git a/tests/test_remote_code_training_gates.py b/tests/test_remote_code_training_gates.py
index a25a5d4aa6c..4648e958ded 100644
--- a/tests/test_remote_code_training_gates.py
+++ b/tests/test_remote_code_training_gates.py
@@ -477,7 +477,6 @@ def test_core_keeps_the_wrapper_generation_config():
@pytest.mark.parametrize("spelling", ["LoRA", "lora ", "LORA"])
def test_adapter_save_spellings_of_a_text_core_are_not_refused(spelling, tmp_path):
from unsloth.save import unsloth_generic_save
-
core = _text_trainable_core(_OmniWrapper(_Cfg()))
try:
unsloth_generic_save(core, None, str(tmp_path), save_method = spelling)
@@ -492,7 +491,9 @@ def test_full_finetuned_remote_child_core_is_refused(tmp_path):
from unsloth.save import unsloth_generic_save
core = _text_trainable_core(_OmniWrapper(_Cfg()))
- core.__class__ = type(type(core).__name__, (type(core),), {"__module__": "transformers_modules.repo.modeling"})
+ core.__class__ = type(
+ type(core).__name__, (type(core),), {"__module__": "transformers_modules.repo.modeling"}
+ )
with pytest.raises(NotImplementedError, match = "remote code"):
unsloth_generic_save(core, None, str(tmp_path), save_method = "merged_16bit")
assert not os.listdir(tmp_path)
diff --git a/unsloth/save.py b/unsloth/save.py
index ea01a9efbae..6fc1e2af041 100644
--- a/unsloth/save.py
+++ b/unsloth/save.py
@@ -5460,7 +5460,9 @@ def _push_merged_to_hub_revision(save_kwargs):
def _refuse_unsaveable_text_core(model, save_method):
"""A helper, not inline: unsloth_generic_save forwards its own locals() as keywords."""
- get_base_model = getattr(model, "get_base_model", None) if isinstance(model, PeftModel) else None
+ get_base_model = (
+ getattr(model, "get_base_model", None) if isinstance(model, PeftModel) else None
+ )
core = get_base_model() if callable(get_base_model) else model
# A str set by _text_trainable_core; mocks answer any attribute with a truthy stand-in.
parent = getattr(core, "_unsloth_composed_parent", None)