fix(gui): only offer Hugging Face tasks the operator can run - #7904
Open
PG1204 wants to merge 1 commit into
Open
fix(gui): only offer Hugging Face tasks the operator can run#7904PG1204 wants to merge 1 commit into
PG1204 wants to merge 1 commit into
Conversation
Contributor
Automated Reviewer SuggestionsBased on the
|
Contributor
Backport auto-label reportThis
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7904 +/- ##
=========================================
Coverage 92.36% 92.36%
Complexity 4583 4583
=========================================
Files 1173 1173
Lines 47347 47349 +2
Branches 5306 5306
=========================================
+ Hits 43733 43735 +2
Misses 2018 2018
Partials 1596 1596
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
Author
|
/request-review @xuang7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
The task dropdown offered six tasks the operator has no codegen for:
text-classification,token-classification,translation,summarization,feature-extraction, andfill-mask. Selecting one silently fell back to text-generation and wrote raw JSON into the result column. The dynamic/api/tasksfetch could surface further unsupported tags on top of that. Meanwhile four tasks that are supported (image-to-image,image-text-to-text,text-to-image,text-to-video) were missing from the list.STATIC_TASK_OPTIONSis now exactly the 20 tasks with a registered codegen, grouped by the codegen that handles them, and aSUPPORTED_TASK_TAGSset derived from it filters the dynamic/api/tasksresult. If that filter leaves nothing, say HF renames its tags, the static list is used rather than an empty dropdown. A comment ties the list toHuggingFaceInferenceOpDesc.registeredCodegensso the two stay in sync.Any related issues?
Closes #7047
How was this PR tested?
95 tests pass in
hugging-face.component.spec.ts, and Prettier is clean. Five tests were added: the unsupported tasks are absent from the list, the four newly added supported tasks are present,SUPPORTED_TASK_TAGSmirrors the static tags, an API response mixing supported and unsupported tasks is filtered down to the supported ones, and an all-unsupported response falls back to the static list.Was this PR authored or co-authored using generative AI tooling?
Yes, this PR was co-authored with Claude in compliance with ASF policy.