-
Notifications
You must be signed in to change notification settings - Fork 591
Stop post-training tripping on config a model never set #4973
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -379,6 +379,12 @@ def main(config, test_args): # pylint: disable=W0621 | |||||||||
| try: | ||||||||||
| max_logging.log(f"Loading tokenizer from {path}.") | ||||||||||
| tokenizer = AutoTokenizer.from_pretrained(path, token=hf_token, trust_remote_code=test_args.trust_remote_code) | ||||||||||
| # Mistral and Llama tokenizers ship no pad token, and the calls below pass padding=True, which | ||||||||||
| # transformers refuses without one ("Asking to pad but the tokenizer does not have a padding | ||||||||||
| # token"). Prompts are tokenized one at a time here, so nothing is ever actually padded and | ||||||||||
| # borrowing eos changes no result -- it only satisfies the check that rejects the call. | ||||||||||
| if tokenizer.pad_token is None: | ||||||||||
| tokenizer.pad_token = tokenizer.eos_token | ||||||||||
|
Comment on lines
+386
to
+387
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If
Suggested change
|
||||||||||
| break | ||||||||||
| except Exception as e: # pylint: disable=broad-except,broad-exception-caught | ||||||||||
| last_exception = e | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
mhc_expansion_rateis explicitly set toNonein the configuration,getattr(config, "mhc_expansion_rate", 1)will returnNonebecause the attribute exists but its value isNone. ComparingNone > 1will then raise aTypeError. To prevent this, we should ensure a fallback value of1is used if the attribute is either missing orNone.