-
Notifications
You must be signed in to change notification settings - Fork 554
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
[InferenceClient] Automatically handle outdated task parameters #2633
base: main
Are you sure you want to change the base?
[InferenceClient] Automatically handle outdated task parameters #2633
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
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.
Thanks @hanouticelina, impressive work!
⚠️ the docstring parsing code is a little bit clunky as it's quite difficult to extract or update a parameter's docstring in a structured way using libcst. this implementation relies on heuristics heavily based on the "format" of the method docstring.
Let's hope it'll not break too often (I'm quite confident). Let's remember the utility is only meant to help us and is not publicly released so it's fine to have more clunky logic there.
This PR will complete some tasks from #2063.
The PR adds the possibility to automatically check for outdated parameters of task methods in the inference client, aligning these task methods with their corresponding parameter specs. More specifically, the script will check and update parameter types and docstrings. The latter is the most possible to happen as parameter descriptions tend to change more frequently.
some changes in the inference client code are automatically generated after re-running
utils/generate_inference_types.py
andutils/check_task_parameters.py
to be able to import some missing type aliases fromhuggingface_hub/inference/_generated_types
module.