-
Notifications
You must be signed in to change notification settings - Fork 470
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
Fixing the CI with the new huggingface-hub
version
#3329
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
✅ No broken markdown links found! |
instance_type=self.config.instance_type, | ||
region=self.config.region, | ||
vendor=self.config.vendor, | ||
repository=validated_config["repository"], |
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.
Why are these attributes optional in the config if they're not actually optional when creating the inference endpoint? It feels like we could just fail much ealier and avoid this hack with dicts that prevent any type checking if we just made them required? Maybe @safoinme has an answer?
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 am also not sure myself. This was an external contribution and I am not sure what will happen for the people who already use this integration if I change optional values into required values in this configuration. As the call only happens in the provision
call, I decided to go with this quick and dirty approach. As you said, perhaps @safoinme can shed more light on this.
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.
It seems the base class with the optionals is also used for the component config (but then simply not used from what I can see), so I guess we need to leave it optional here and refactor at some point..
@@ -253,15 +298,13 @@ def predict(self, data: "Any", max_new_tokens: int) -> "Any": | |||
) | |||
if self.prediction_url is not None: | |||
if self.hf_endpoint.task == "text-generation": | |||
result = self.inference_client.task_generation( |
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.
Btw @schustmi, this one confused me a bit. The inference client of Huggingface never had a method called task_generation
. Not in this version, nor in the version that we used to install in the old and green CI. This was an error even a week ago, but somehow, we started seeing this error with the new release of huggingface-hub
, (the mypy
version in both cases is the same). Any idea how this can happen?
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.
They probably introduced typing in their newest release, which means before the inference_client
was simply Any
which means calling any method on it won't lead to a mypy error
instance_type=self.config.instance_type, | ||
region=self.config.region, | ||
vendor=self.config.vendor, | ||
repository=validated_config["repository"], |
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.
It seems the base class with the optionals is also used for the component config (but then simply not used from what I can see), so I guess we need to leave it optional here and refactor at some point..
Describe changes
I implemented/fixed _ to achieve _.
Pre-requisites
Please ensure you have done the following:
develop
and the open PR is targetingdevelop
. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.Types of changes