Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with EarlyStoppingCallback when do_eval is set to False, minor refactoring #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

poteminr
Copy link

@poteminr poteminr commented Mar 9, 2024

Fix bug with EarlyStoppingCallback when do_eval is set to False

EarlyStoppingCallback can be used if validation_file, save_strategy policy were provided, load_best_model_at_end was set to True, and so on.

AssertionError: EarlyStoppingCallback requires IntervalStrategy of steps or epoch

Otherwise, we should set callbacks in BinderTrainer to None.

HF DefaultFlowCallback will be use by default (source).

Minor refactoring

  1. Remove repeated lines, add spaces (src/config.py)
  2. initialize batch dict at once with the values (src/trainer.py)
  3. Remove unusedstart_negative_mask, end_negative_mask, span_negative_mask = [], [], []. This variables initialized below with a tensors (src/trainer.py)

@poteminr
Copy link
Author

poteminr commented Mar 9, 2024

@microsoft-github-policy-service agree

@poteminr
Copy link
Author

@sheng-z Hi! Can you review my PR?

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