Skip to content

fix: pass train_dataset and eval_dataset to CloneDetectionTrainer constructor - #3

Merged
jorge-martinez-gil merged 1 commit into
mainfrom
jorge-martinez-gil/fix-eval-dataset-trainer
May 28, 2026
Merged

fix: pass train_dataset and eval_dataset to CloneDetectionTrainer constructor#3
jorge-martinez-gil merged 1 commit into
mainfrom
jorge-martinez-gil/fix-eval-dataset-trainer

Conversation

@jorge-martinez-gil

Copy link
Copy Markdown
Owner

HuggingFace's Trainer.__init__ validates that eval_dataset is provided whenever eval_strategy is not "no". Because get_training_args defaults eval_strategy to "epoch", constructing CloneDetectionTrainer without datasets caused an immediate ValueError before any training could begin.

The fix passes train_dataset and eval_dataset directly to the constructor in run_clone_experiment.py. The run() method already assigns them internally, but the constructor validation fires first and requires them upfront.

…structor

The Trainer.__init__ validates that eval_dataset is provided when
eval_strategy='epoch' is set. Datasets were previously only assigned
in run(), causing the ValueError before training could start.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jorge-martinez-gil
jorge-martinez-gil merged commit c4d8a86 into main May 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant