fix: guard _output_dir in PretrainTrainerWrapper.train()

Prevent silent failure if setup() partially completes by checking
both self.trainer and self._output_dir before proceeding.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alpamys 2026-03-25 22:29:29 +05:00
parent 15a6daf342
commit 4d34924d8f
1 changed files with 1 additions and 1 deletions

View File

@ -263,7 +263,7 @@ class PretrainTrainerWrapper:
resume_from_checkpoint: Optional[str] = None,
) -> dict:
"""Run continued pre-training and return results summary."""
if self.trainer is None:
if self.trainer is None or self._output_dir is None:
raise RuntimeError(
"PretrainTrainerWrapper.train() called before setup(). "
"Call setup(dataset) first."