fix: comment out debug print statements (#4357)
This commit is contained in:
parent
37fe04f7bf
commit
a0aba96ebd
2 changed files with 34 additions and 34 deletions
|
|
@ -3270,25 +3270,25 @@ class UnslothTrainer:
|
|||
logger.info(f"Post-filter dataset size: {filtered_len} samples\n")
|
||||
|
||||
# [DEBUG] Decode first sample AFTER train_on_completions applied
|
||||
try:
|
||||
_row = self.trainer.train_dataset[0]
|
||||
_space = self.tokenizer(
|
||||
" ", add_special_tokens = False
|
||||
).input_ids[0]
|
||||
print("[DEBUG] === After train_on_completions ===", flush = True)
|
||||
print(
|
||||
f"[DEBUG] input_ids decoded:\n{self.tokenizer.decode(_row['input_ids'])}\n",
|
||||
flush = True,
|
||||
)
|
||||
print(
|
||||
f"[DEBUG] labels decoded (-100 → space):\n{self.tokenizer.decode([_space if x == -100 else x for x in _row['labels']])}\n",
|
||||
flush = True,
|
||||
)
|
||||
except Exception as _dbg_e:
|
||||
print(
|
||||
f"[DEBUG] Could not decode post-completions sample: {_dbg_e}",
|
||||
flush = True,
|
||||
)
|
||||
# try:
|
||||
# _row = self.trainer.train_dataset[0]
|
||||
# _space = self.tokenizer(
|
||||
# " ", add_special_tokens = False
|
||||
# ).input_ids[0]
|
||||
# print("[DEBUG] === After train_on_completions ===", flush = True)
|
||||
# print(
|
||||
# f"[DEBUG] input_ids decoded:\n{self.tokenizer.decode(_row['input_ids'])}\n",
|
||||
# flush = True,
|
||||
# )
|
||||
# print(
|
||||
# f"[DEBUG] labels decoded (-100 → space):\n{self.tokenizer.decode([_space if x == -100 else x for x in _row['labels']])}\n",
|
||||
# flush = True,
|
||||
# )
|
||||
# except Exception as _dbg_e:
|
||||
# print(
|
||||
# f"[DEBUG] Could not decode post-completions sample: {_dbg_e}",
|
||||
# flush = True,
|
||||
# )
|
||||
|
||||
except Exception as e:
|
||||
logger.warning(f"Failed to apply train on responses only: {e}")
|
||||
|
|
|
|||
|
|
@ -314,21 +314,21 @@ def run_training_process(
|
|||
# [DEBUG] Print first sample before model is loaded
|
||||
# dataset is a dict {"dataset": <Dataset>, "detected_format": ..., ...}
|
||||
# or a raw Dataset for audio paths
|
||||
try:
|
||||
ds = dataset["dataset"] if isinstance(dataset, dict) else dataset
|
||||
print(
|
||||
f"\n[DEBUG] Dataset loaded BEFORE model. type={type(ds).__name__}, len={len(ds)}",
|
||||
flush = True,
|
||||
)
|
||||
print(f"[DEBUG] Columns: {ds.column_names}", flush = True)
|
||||
sample = ds[0]
|
||||
preview = {k: str(v)[:300] for k, v in sample.items()}
|
||||
print(f"[DEBUG] First sample: {preview}\n", flush = True)
|
||||
except Exception as e:
|
||||
print(
|
||||
f"[DEBUG] Could not preview first sample: {type(e).__name__}: {e}",
|
||||
flush = True,
|
||||
)
|
||||
# try:
|
||||
# ds = dataset["dataset"] if isinstance(dataset, dict) else dataset
|
||||
# print(
|
||||
# f"\n[DEBUG] Dataset loaded BEFORE model. type={type(ds).__name__}, len={len(ds)}",
|
||||
# flush = True,
|
||||
# )
|
||||
# print(f"[DEBUG] Columns: {ds.column_names}", flush = True)
|
||||
# sample = ds[0]
|
||||
# preview = {k: str(v)[:300] for k, v in sample.items()}
|
||||
# print(f"[DEBUG] First sample: {preview}\n", flush = True)
|
||||
# except Exception as e:
|
||||
# print(
|
||||
# f"[DEBUG] Could not preview first sample: {type(e).__name__}: {e}",
|
||||
# flush = True,
|
||||
# )
|
||||
|
||||
# Disable eval if eval_steps <= 0
|
||||
eval_steps = config.get("eval_steps", 0.00)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue