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
Revert "Tied weights"
Daniel Hane2aa4d6a1a11
diff --git a/unsloth/models/llama.py b/unsloth/models/llama.pyindex 0e9b70a8b27..c0175bbfafe 100644--- a/unsloth/models/llama.py+++ b/unsloth/models/llama.py@@ -1838,8 +1838,7 @@ class FastLlamaModel:except: old_output_embedding = torch.zeros(0)# Check for tied weights as well- # is_tied = old_input_embedding.data_ptr() == old_output_embedding.data_ptr()- is_tied = model.config.tie_word_embeddings+ is_tied = old_input_embedding.data_ptr() == old_output_embedding.data_ptr()# Check pad token's id -> we need to expand the embeddingif len(tokenizer) > old_input_embedding.shape[0]:@@ -1888,9 +1887,6 @@ class FastLlamaModel:else:correct_dtype = old_input_embedding.dtypepass-- # Finally tie them if needed!- if is_tied: model.tie_weights()# Also patch all dtypes - BnB seems to not allocate the correct type?# BnB default dtype seems to be float16!