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 15 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5568 +/- ##
============================================
+ Coverage 57.17% 57.34% +0.16%
- Complexity 3100 3101 +1
============================================
Files 1130 1130
Lines 43825 43978 +153
Branches 4747 4790 +43
============================================
+ Hits 25056 25218 +162
+ Misses 17330 17321 -9
Partials 1439 1439
*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 | 399 | 0.244 | 23,933/38,964/38,964 us | 🔴 +25.6% / 🔴 +154.9% |
| 🔴 | bs=100 sw=10 sl=64 | 800 | 0.488 | 117,670/168,399/168,399 us | 🔴 +22.5% / 🔴 +55.4% |
| ⚪ | bs=1000 sw=10 sl=64 | 944 | 0.576 | 1,059,301/1,111,267/1,111,267 us | ⚪ within ±5% / 🔴 +7.2% |
Baseline details
Latest main 021818d from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 399 tuples/sec | 467 tuples/sec | 770.95 tuples/sec | -14.6% | -48.2% |
| bs=10 sw=10 sl=64 | MB/s | 0.244 MB/s | 0.285 MB/s | 0.471 MB/s | -14.4% | -48.1% |
| bs=10 sw=10 sl=64 | p50 | 23,933 us | 19,819 us | 12,775 us | +20.8% | +87.3% |
| bs=10 sw=10 sl=64 | p95 | 38,964 us | 31,013 us | 15,286 us | +25.6% | +154.9% |
| bs=10 sw=10 sl=64 | p99 | 38,964 us | 31,013 us | 18,795 us | +25.6% | +107.3% |
| bs=100 sw=10 sl=64 | throughput | 800 tuples/sec | 873 tuples/sec | 976.93 tuples/sec | -8.4% | -18.1% |
| bs=100 sw=10 sl=64 | MB/s | 0.488 MB/s | 0.533 MB/s | 0.596 MB/s | -8.4% | -18.2% |
| bs=100 sw=10 sl=64 | p50 | 117,670 us | 113,408 us | 102,557 us | +3.8% | +14.7% |
| bs=100 sw=10 sl=64 | p95 | 168,399 us | 137,465 us | 108,383 us | +22.5% | +55.4% |
| bs=100 sw=10 sl=64 | p99 | 168,399 us | 137,465 us | 115,249 us | +22.5% | +46.1% |
| bs=1000 sw=10 sl=64 | throughput | 944 tuples/sec | 967 tuples/sec | 1,009 tuples/sec | -2.4% | -6.4% |
| bs=1000 sw=10 sl=64 | MB/s | 0.576 MB/s | 0.59 MB/s | 0.616 MB/s | -2.4% | -6.5% |
| bs=1000 sw=10 sl=64 | p50 | 1,059,301 us | 1,032,971 us | 997,695 us | +2.5% | +6.2% |
| bs=1000 sw=10 sl=64 | p95 | 1,111,267 us | 1,078,185 us | 1,036,731 us | +3.1% | +7.2% |
| bs=1000 sw=10 sl=64 | p99 | 1,111,267 us | 1,078,185 us | 1,069,334 us | +3.1% | +3.9% |
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,500.66,200,128000,399,0.244,23933.32,38964.17,38964.17
1,100,10,64,20,2499.44,2000,1280000,800,0.488,117669.81,168398.69,168398.69
2,1000,10,64,20,21183.86,20000,12800000,944,0.576,1059301.20,1111267.30,1111267.30eafce6d to
c009c34
Compare
7d88b62 to
1bf97cb
Compare
1bf97cb to
5f3afac
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.
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.
…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>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
b4769c8 to
191073b
Compare
|
@xuang7 mp4 has been compressed to 116 KB. Both mp4 and wav file were self-created and noted in the PR |
|
Hi @ELin2025, thanks for the PR. Two suggestions:
|
… edge-case tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@xuang7 coverage increased and PR comment edited! |
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?
operator-property-edit-frame.component.spec.ts— 123 new testsmodelId→huggingface,imageInput→huggingface-image-upload,audioInput→huggingface-audio-uploadhugging-face-image-upload.component.spec.ts— 27 new testshugging-face.component.spec.ts— 11 new testshugging-face-audio-upload.component.spec.ts— 7 new testsRun with
ng test.Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.6