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

Refactor vocabulary info in recipes #1094

Merged
merged 3 commits into from
Mar 25, 2025
Merged

Refactor vocabulary info in recipes #1094

merged 3 commits into from
Mar 25, 2025

Conversation

cbalioglu
Copy link
Contributor

This PR bundles three features:

  • Removes vocab_info from SequenceModel and Seq2SeqModel and relies on the passed tokenizer to infer the vocabulary information.
  • Per user feedback, fairseq2.recipes.common functions now expect as argument specific configuration sections instead of the general recipe configuration for better readability and mypy compatibility.
  • Removes the _add_ directive for configuration handling and extends _set_ to handle both adding and setting configuration keys. This also makes the logic consistent with _set_ being the equivalent of dict[key] = value and _del_ being the equivalent of del dict[key].

@cbalioglu cbalioglu requested a review from zyaoj as a code owner March 25, 2025 13:30
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 25, 2025
@cbalioglu cbalioglu changed the title Vocab Refactor vocabulary info in recipes Mar 25, 2025
@cbalioglu cbalioglu merged commit 31465ac into main Mar 25, 2025
15 checks passed
@cbalioglu cbalioglu deleted the vocab branch March 25, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants