The GitHub Actions job "Required Checks" on texera.git/main has succeeded.
Run started by GitHub user github-merge-queue[bot] (triggered by 
github-merge-queue[bot]).

Head commit for run:
797674477846b722cccd926b8928b3514b6a5993 / Prateek Ganigi 
<[email protected]>
fix(gui): only offer Hugging Face tasks the operator can run (#7904)

### 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`, and `fill-mask`. Selecting one
silently fell back to text-generation and wrote raw JSON into the result
column. The dynamic `/api/tasks` fetch 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_OPTIONS` is now exactly the 20 tasks with a registered
codegen, grouped by the codegen that handles them, and a
`SUPPORTED_TASK_TAGS` set derived from it filters the dynamic
`/api/tasks` result. 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 to `HuggingFaceInferenceOpDesc.registeredCodegens` so 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_TAGS` mirrors 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.

Report URL: https://github.com/apache/texera/actions/runs/33668037926

With regards,
GitHub Actions via GitBox

Reply via email to