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
Fix Chunking loop can hang when stride ≥ chunk_size
vangmay96eba88c90ac
diff --git a/unsloth/dataprep/raw_text.py b/unsloth/dataprep/raw_text.pyindex b880e973389..f7c1bf78567 100644--- a/unsloth/dataprep/raw_text.py+++ b/unsloth/dataprep/raw_text.py@@ -101,6 +101,13 @@ class RawTextDataLoader:3. Maintains context with stride overlap4. Returns tokenized chunks directly (more efficient) or text chunks"""+ if chunk_size <= 0:+ raise ValueError(f"chunk_size must be positive, got {chunk_size}")+ if stride >= chunk_size:+ raise ValueError(+ f"stride ({stride}) must be smaller than chunk_size ({chunk_size}) to progress the chunking loop"+ )+# First pass: tokenize the entire text to get accurate token countstokenized = self.tokenizer(text, return_tensors = "pt", add_special_tokens = False)tokens = tokenized["input_ids"]