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 synthetic.py

Daniel Han9b8556a100ce
diff --git a/unsloth/dataprep/synthetic.py b/unsloth/dataprep/synthetic.py
index ec18104f75f..e54bb53eb7a 100644
--- a/unsloth/dataprep/synthetic.py
+++ b/unsloth/dataprep/synthetic.py
@@ -206,7 +206,7 @@ class SyntheticDataKit:
with open(filename, "r") as f: text = f.read()
- max_tokens = self.max_seq_length - self.max_generation_tokens*3 # * 3 to reduce errors
+ max_tokens = self.max_seq_length - self.max_generation_tokens*2 - 128 # -128 to reduce errors
if max_tokens <= 5:
raise RuntimeError("Generation length is way too long!")
input_ids = self.tokenizer(text, add_special_tokens = False).input_ids