feat(frontend): add task-aware field visibility and preview to HuggingFace property editor#5568
feat(frontend): add task-aware field visibility and preview to HuggingFace property editor#5568ELin2025 wants to merge 12 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5568 +/- ##
============================================
- Coverage 56.37% 56.35% -0.03%
+ Complexity 2991 2986 -5
============================================
Files 1129 1129
Lines 43802 43924 +122
Branches 4743 4786 +43
============================================
+ Hits 24694 24753 +59
- Misses 17658 17715 +57
- Partials 1450 1456 +6
*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:
|
|
/request-review @Ma77Ball |
Ma77Ball
left a comment
There was a problem hiding this comment.
Left comments for review below.
553d90d to
d1dc52a
Compare
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 392 | 0.239 | 25,475/36,012/36,012 us | 🔴 +7.9% / 🔴 +143.6% |
| 🟢 | bs=100 sw=10 sl=64 | 828 | 0.506 | 118,141/142,507/142,507 us | 🟢 -23.1% / 🔴 +33.3% |
| ⚪ | bs=1000 sw=10 sl=64 | 938 | 0.573 | 1,067,081/1,115,481/1,115,481 us | ⚪ within ±5% / 🔴 +9.0% |
Baseline details
Latest main 878eb8a from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 392 tuples/sec | 418 tuples/sec | 786.27 tuples/sec | -6.2% | -50.1% |
| bs=10 sw=10 sl=64 | MB/s | 0.239 MB/s | 0.255 MB/s | 0.48 MB/s | -6.3% | -50.2% |
| bs=10 sw=10 sl=64 | p50 | 25,475 us | 23,614 us | 12,495 us | +7.9% | +103.9% |
| bs=10 sw=10 sl=64 | p95 | 36,012 us | 35,094 us | 14,784 us | +2.6% | +143.6% |
| bs=10 sw=10 sl=64 | p99 | 36,012 us | 35,094 us | 18,468 us | +2.6% | +95.0% |
| bs=100 sw=10 sl=64 | throughput | 828 tuples/sec | 782 tuples/sec | 991.49 tuples/sec | +5.9% | -16.5% |
| bs=100 sw=10 sl=64 | MB/s | 0.506 MB/s | 0.478 MB/s | 0.605 MB/s | +5.9% | -16.4% |
| bs=100 sw=10 sl=64 | p50 | 118,141 us | 118,813 us | 100,929 us | -0.6% | +17.1% |
| bs=100 sw=10 sl=64 | p95 | 142,507 us | 185,337 us | 106,894 us | -23.1% | +33.3% |
| bs=100 sw=10 sl=64 | p99 | 142,507 us | 185,337 us | 114,085 us | -23.1% | +24.9% |
| bs=1000 sw=10 sl=64 | throughput | 938 tuples/sec | 926 tuples/sec | 1,023 tuples/sec | +1.3% | -8.3% |
| bs=1000 sw=10 sl=64 | MB/s | 0.573 MB/s | 0.565 MB/s | 0.624 MB/s | +1.4% | -8.2% |
| bs=1000 sw=10 sl=64 | p50 | 1,067,081 us | 1,085,941 us | 983,835 us | -1.7% | +8.5% |
| bs=1000 sw=10 sl=64 | p95 | 1,115,481 us | 1,129,206 us | 1,023,777 us | -1.2% | +9.0% |
| bs=1000 sw=10 sl=64 | p99 | 1,115,481 us | 1,129,206 us | 1,053,883 us | -1.2% | +5.8% |
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,510.49,200,128000,392,0.239,25474.83,36011.51,36011.51
1,100,10,64,20,2414.33,2000,1280000,828,0.506,118140.76,142506.85,142506.85
2,1000,10,64,20,21321.19,20000,12800000,938,0.573,1067081.03,1115480.66,1115480.66eafce6d to
c009c34
Compare
7d88b62 to
1bf97cb
Compare
1bf97cb to
5f3afac
Compare
57f7306 to
bdcd1c8
Compare
Automated Reviewer SuggestionsBased on the
|
fcb2185 to
9c67820
Compare
xuang7
left a comment
There was a problem hiding this comment.
Overall, this looks good to me. Please update the target branch to the latest main and rebase your branch, as the current diff includes some unrelated changes. Thanks.
748349b to
94bc7b2
Compare
…gFace property editor Show/hide operator fields based on the selected HuggingFace task (e.g., imageInput only for image tasks, contextColumn only for question-answering). Adds task preview cards with media samples per task kind (image/video/audio/text), custom validators for required inputs, and ~13 field visibility rules inside the formly jsonSchemaMapIntercept. Co-Authored-By: Anish Shivamurthy <anish@uci.edu>
Add mockHuggingFaceSchema and mockHuggingFacePredicate to test infrastructure. Add 7 spec tests covering huggingFaceTaskPreview for known tasks (text, image, audio, video), unknown tasks (fallback), empty tasks, and non-HF operators.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ew sample Fix inverted fallback for systemPrompt/maxNewTokens/temperature: these fields now correctly hide when no task is selected, matching the behavior of all other HuggingFace fields. Add missing image-text-to-text entry to huggingFaceTaskPreviewSamples so it no longer falls through to the generic text fallback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add sample-video.mp4 and sample-audio.wav for task preview cards - Check hasOperator() before getOperator() in isHuggingFaceOperator() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…lassification Prefer self.CANDIDATE_LABELS over prompt column for candidate labels, with fallback to prompt_value for backward compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cover hide expressions for imageInput, audioInput, promptColumn, systemPrompt, contextColumn, and candidateLabels across task types. Also test requiredPromptColumn, requiredImageInput, and requiredAudioInput validators pass/fail for relevant tasks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…iew tests Add tests for sentencesColumn, inputImageColumn, inputAudioColumn visibility, validator edge cases with column fallbacks, and additional task preview kinds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ation show:true
Add missing image-to-video task to imageInputTasks so the image input
field appears for that task. Remove validation: { show: true } from
imageInput, audioInput, and promptColumn so errors only appear after
the field is touched, not on a freshly-added operator.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…fields Add tests for field type assignments, undefined task visibility, image-to-video/image-to-image/document-question-answering tasks, audio-classification, prompt column visibility for mixed tasks, validator formControl value paths, additional task previews, and deleted operator guard. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
600ba81 to
319fbe4
Compare
|
@xuang7 branch has been rebased |
xuang7
left a comment
There was a problem hiding this comment.
Overall looks good!
sample-audio.wav (170 KB) and sample-video.mp4 (1.25 MB) are new binary files. Could you confirm whether they are self-created or under an ASF-compatible license, and note the source in the PR? Also, the .mp4 is relatively large for a preview thumbnail, so compressing or shortening it would be nice.
What changes were proposed in this PR?
Wire up the HuggingFace operator's property editor so that selecting a task dynamically controls which fields are visible and shows a media preview card. This is the PR that makes the formly components from PRs #5566/ #5567 user-visible by mapping operator fields to custom field types in
jsonSchemaMapIntercept.Changes to
operator-property-edit-frame.component.ts:modelId→huggingfaceformly type,imageInput→huggingface-image-upload,audioInput→huggingface-audio-uploadtaskfield (it is controlled by the HuggingFaceComponent's task dropdown instead)imageInputonly for image tasks,contextColumnonly for question-answering,systemPrompt/maxNewTokens/temperatureonly for text-generation)requiredImageInput,requiredAudioInput,requiredPromptColumn— each checks whether the direct input or the corresponding column selector is filledvalidation: { show: true }from imageInput, audioInput, and promptColumn so errors only appear after the field is touched, not on a freshly-added operatorimage-to-videotoimageInputTasksso the image input field appears for that taskChanges to test infrastructure:
mockHuggingFaceSchemainmock-operator-metadata.data.ts(added tomockOperatorSchemaList)mockHuggingFacePredicateinmock-workflow-data.tsAny related issues, documentation, discussions?
How was this PR tested?
69 unit tests (24 new) in
operator-property-edit-frame.component.spec.tscovering:modelId→huggingface,imageInput→huggingface-image-upload,audioInput→huggingface-audio-uploadRun with
ng test.Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.6