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 synthetic.py
Daniel Hane27063fd5c9d
diff --git a/unsloth/dataprep/synthetic.py b/unsloth/dataprep/synthetic.pyindex 5fc6e6c577f..a49a312a9dc 100644--- a/unsloth/dataprep/synthetic.py+++ b/unsloth/dataprep/synthetic.py@@ -205,15 +205,13 @@ class SyntheticDataKit:original_n_tokens = len(input_ids)if len(input_ids) > max_tokens:- # Will fix later, but for now we simply naively truncate by 10% increments- ratio = 0.9+ # Will fix later, but for now we simply naively truncate by 100 in lengthlength = original_lengthwhile True:input_ids = self.tokenizer(text[:length]).input_idsif len(input_ids) < max_tokens or length == 0: break- length = int(original_length * ratio)+ length -= 100length = max(length, 0)- ratio -= 0.1passprint(f"Unsloth: Will truncate your data which has {original_n_tokens} tokens to {len(input_ids)} tokens.")