-
Notifications
You must be signed in to change notification settings - Fork 571
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
[Inference Client] Add task parameters and a maintenance script of these parameters #2561
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. |
This PR will complete some tasks from #2063 :) |
The goal of the script
A first implementation was done using
libCST operates on a tree-like structure that represents the entire source code, including whitespace and comments. Here, we leverage two main concepts:
The script is still experimental and there are known limitations (non-exhaustive):
|
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.
Looks good!
Thanks for the explanations about LibCST. It seems like the right tool to use in our case. Since it's a dev dependency, it's fine adding it. To be honest I did not review the full utils/generate_task_parameters.py
script but I'm pretty confident it does the job. Let's hope it'll not become a nightmare to maintain (same for all utils/
scripts^^). If it starts to be the case, we can always reassess. Updating utils is less stressful given we don't have to think about backward compatibility.
Apart from the comments below, I think it's pretty much ready to merge :)
…ign-inference-inputs-with-specs
@Wauplin do you have an idea why the build of the PR documentation is failing? my guess: private message |
…gface/huggingface_hub into align-inference-inputs-with-specs
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 for removing the remaining aliases. Everything looks good to merge now :)
Fixes #2557.
This PR adds the possibility to pass additional parameters to task methods in the inference client, aligning these task methods with their corresponding parameter specs.
Key changes
audio-classification
,document-question-answering
,fill-mask
,image-classification
,image-segmentation
,object-detection
,question-answering
,summarization
,text-classification
,token-classification
,translation
andzero-shot-image-classification
.parameters
argument, inconsistent with task specifications #2557 for related discussion.utils/generate_inference_types.py
to add task-specific prefixes to shared type aliases:ClassificationOutputTransform
toTextClassificationOutputTransform
for text-classification taskutils/
.Note:
automatic-speech-recognition
andimage-to-text
tasks are not included in this update due to an existing parameter naming discrepancy (see issue here).