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 RMS LayerNorm implementation, and list compr. change in chat templates (#1974)

Nino Risteskif4d97caf5eb6
diff --git a/unsloth/chat_templates.py b/unsloth/chat_templates.py
index 2c2e36182df..c10b2641a4a 100644
--- a/unsloth/chat_templates.py
+++ b/unsloth/chat_templates.py
@@ -1512,10 +1512,7 @@ def get_ollama_eos_tokens(tokenizer, extra_eos_tokens = []):
# Remove duplicates
splitted = joined_text.split("\x01\x00")
- final_eos_tokens = []
- for old, new in zip(added_tokens_decoder, splitted):
- if old == new: final_eos_tokens.append(old)
- pass
+ final_eos_tokens = [old for old, new in zip(added_tokens_decoder, splitted) if old == new]
final_eos_tokens += extra_eos_tokens
final_eos_tokens += repeatted_tokens
diff --git a/unsloth/kernels/rms_layernorm.py b/unsloth/kernels/rms_layernorm.py
index ce61cef72ed..8f54e749089 100644
--- a/unsloth/kernels/rms_layernorm.py
+++ b/unsloth/kernels/rms_layernorm.py
@@ -256,7 +256,6 @@ def unpatch_rms_layernorm():
except:
pass
return
- return
pass