-
Notifications
You must be signed in to change notification settings - Fork 49
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: Remove deprecated push_to_hub_token to resolve warning #419
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Luka Dojcinovic <[email protected]>
Thanks for making a pull request! 😃 |
Because of this change, also had to change how the field names are obtained from SFTConfig. Signed-off-by: Luka Dojcinovic <[email protected]>
Summary of changes made with 9e567e2 It seems that using .to_dict() method on Because of the change to In summary, the changes to
All code has passed Please let me know your thoughts, thank you. |
Signed-off-by: Luka Dojcinovic <[email protected]>
tuning/sft_trainer.py
Outdated
@@ -346,10 +345,10 @@ def train( | |||
# from our object directly. In the future, we should consider renaming this class and / or | |||
# not adding things that are not directly used by the trainer instance to it. | |||
|
|||
transformer_train_arg_fields = [x.name for x in dataclasses.fields(SFTConfig)] | |||
transformer_train_arg_fields = SFTConfig.__dict__["__match_args__"] |
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.
Use of __match_args__
requires Python>=3.10 isn't it? Correct me.
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.
Yes, I believe it is Python 3.10 and greater. Although I'm a little confused on whether __match_args__
are auto generated by Python when creating a class or manually set by those writing the class. As it is now, it is a key in the dictionary, so I wonder if the key would still exist in Python 3.9 and lower.
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.
I guess we should avoid usage of __match_args__
in that case, WDYT?
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.
I guess so, which version of Python is the lowest supported by fms-hf-tuning repo?
Also, if we remove __match_args__
do you know another way to get all the input variables for SFTConfig
as listed here? Using __dict__.keys()
only returns the 12 parameters, but I need all of the variables that SFTConfig
inherits from TrainingArguments
class. For example, output_dir
, do_train
, do_eval
etc.
Signed-off-by: Luka Dojcinovic <[email protected]>
I made small change with c7d540e. I changed |
Description of the change
Running tuning locally produces this warning message:
When I print out the
transformer_kwargs
dictionary, I can see that bothhub_token
andpush_to_hub_token
are in the dictionary. Here is a snippet of it.I made a temporary fix by simply popping
push_to_hub_token
out of the dictionary and now the warning is gone.I am wondering if anyone knows where
push_to_hub_token
is originating from or best way to remove it.Related issue number
Issue #1205
How to verify the PR
Run tuning locally: