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

Daniel Han8f14160dbb5f
diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py
index 1d413f0acce..68aa527990e 100644
--- a/unsloth/models/llama.py
+++ b/unsloth/models/llama.py
@@ -1706,18 +1706,19 @@ class FastLlamaModel:
spaces = re.search('\n([\s\t]{1,})', original_debug).group(0)[1:]
front_spaces = re.match('([\s\t]{1,})', inner_training_loop).group(0)
- debug_info = """debug_info = \\
unsloth_0 = r'==((====))=='
unsloth_1 = r' \\ /| '
unsloth_2 = r'O^O/ \_/ \ '
unsloth_3 = r'\ / '
unsloth_4 = r' "-____-" '
+
+ debug_info = """debug_info = \\
f"{unsloth_0} Unsloth - 2x faster free finetuning | Num GPUs = {args.world_size}\\n"\\
f"{unsloth_1} Num examples = {num_examples:,} | Num Epochs = {num_train_epochs:,}\\n"\\
f"{unsloth_2} Batch size per device = {self._train_batch_size:,} | Gradient Accumulation steps = {args.gradient_accumulation_steps}\\n"\\
f"{unsloth_3} Total batch size = {total_train_batch_size:,} | Total steps = {max_steps:,}\\n"\\
f'{unsloth_4} Number of trainable parameters = {get_model_param_count(model, trainable_only=True):,}'
- print(debug_info)
+ logger.warning(debug_info)
import subprocess, re, gc, numpy as np
a = np.array([0,])
try:
@@ -1733,6 +1734,14 @@ class FastLlamaModel:
gc.collect()
torch.cuda.empty_cache()"""
+ print(debug_info)
+ debug_info = debug_info\
+ .replace("{unsloth_0}", unsloth_0)\
+ .replace("{unsloth_1}", unsloth_1)\
+ .replace("{unsloth_2}", unsloth_2)\
+ .replace("{unsloth_3}", unsloth_3)\
+ .replace("{unsloth_4}", unsloth_4)
+
debug_info = debug_info.split('\n')
debug_info = "\n".join([debug_info[0]] + [spaces + x[8:] for x in debug_info[1:]])
inner_training_loop = inner_training_loop.replace(original_debug, debug_info)