-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[ENH] allow passing of transformer object to hugging face transformer #6642
base: main
Are you sure you want to change the base?
Conversation
@@ -101,7 +102,8 @@ class HFTransformersForecaster(BaseForecaster): | |||
|
|||
def __init__( | |||
self, | |||
model_path: str, | |||
model_path: str = None, |
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 would propose to use in future only model and set a deprecation warning for model_path
because in my opinion this additional kwarg is not necessary, since model_path and model has basically the same meaning.
@fkiraly any opinions
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.
@benHeid
If that is the case, can we import the warnings
dependency in the start?
Would it interfere in the checks during build process?
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.
Thank you for the PR. Beside the change requests, please also rebase on the main branch, sine the progress bar changes are part of a different PR.
) | ||
if self.model is None and self.model_path is not None: | ||
# Load model and extract config | ||
config = AutoConfig.from_pretrained(self.model_path) |
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 would propose to move the model loading functionality into a private method to keep the fit method simpler. E.g. into a method _load_model
@benHeid | @fkiraly | @achieveordie | @yarnabrina
|
@fkiraly & @benHeid
Invoking model object for the Issue #6561