Skip to content

Conversation

@ma-kjh
Copy link
Contributor

@ma-kjh ma-kjh commented Nov 25, 2025

Add logic to retain evaluation data during unlearning.

What does this PR do?

This PR fixes a ValueError that occurs when running the unlearning process with eval_strategy="epoch" or "steps".

Problem

Currently, in src/data/__init__.py, when mode="unlearn", the code merges the splits into a single train dataset and then pops (removes) the original splits (including retain) from the data dictionary.
As a result, when the Trainer tries to access eval_dataset (typically the retain set), it finds None, causing the following error:
ValueError: You have set args.eval_strategy to IntervalStrategy.EPOCH but you didn't pass an eval_dataset to Trainer.

Solution

I added logic to assign the retain split to data["eval"] before popping the splits. This ensures that the Trainer has access to evaluation data during the unlearning process.

Fixes # (issue)
N/A

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Have you gone through the contributions guide?
  • Are your changes documented? Read documentation guidelines here.

Add logic to retain evaluation data during unlearning.
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