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 33 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5568 +/- ##
============================================
- Coverage 54.09% 53.62% -0.47%
Complexity 2817 2817
============================================
Files 1103 1108 +5
Lines 42650 43319 +669
Branches 4588 4715 +127
============================================
+ Hits 23070 23229 +159
- Misses 18236 18727 +491
- Partials 1344 1363 +19
*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 | 546 | 0.333 | 17,499/25,560/25,560 us | 🔴 -5.1% / 🟢 +32.9% |
| 🔴 | bs=100 sw=10 sl=64 | 1,117 | 0.682 | 83,957/207,433/207,433 us | 🔴 +71.1% / 🔴 +48.4% |
| ⚪ | bs=1000 sw=10 sl=64 | 1,427 | 0.871 | 704,917/742,323/742,323 us | ⚪ within ±5% / 🟢 +37.1% |
Baseline details
Latest main 8803d08 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 546 tuples/sec | 575 tuples/sec | 410.82 tuples/sec | -5.0% | +32.9% |
| bs=10 sw=10 sl=64 | MB/s | 0.333 MB/s | 0.351 MB/s | 0.251 MB/s | -5.1% | +32.8% |
| bs=10 sw=10 sl=64 | p50 | 17,499 us | 17,282 us | 23,785 us | +1.3% | -26.4% |
| bs=10 sw=10 sl=64 | p95 | 25,560 us | 25,456 us | 34,980 us | +0.4% | -26.9% |
| bs=10 sw=10 sl=64 | p99 | 25,560 us | 25,456 us | 34,980 us | +0.4% | -26.9% |
| bs=100 sw=10 sl=64 | throughput | 1,117 tuples/sec | 1,204 tuples/sec | 891.94 tuples/sec | -7.2% | +25.2% |
| bs=100 sw=10 sl=64 | MB/s | 0.682 MB/s | 0.735 MB/s | 0.544 MB/s | -7.2% | +25.3% |
| bs=100 sw=10 sl=64 | p50 | 83,957 us | 79,032 us | 112,277 us | +6.2% | -25.2% |
| bs=100 sw=10 sl=64 | p95 | 207,433 us | 121,252 us | 139,802 us | +71.1% | +48.4% |
| bs=100 sw=10 sl=64 | p99 | 207,433 us | 121,252 us | 139,802 us | +71.1% | +48.4% |
| bs=1000 sw=10 sl=64 | throughput | 1,427 tuples/sec | 1,437 tuples/sec | 1,041 tuples/sec | -0.7% | +37.1% |
| bs=1000 sw=10 sl=64 | MB/s | 0.871 MB/s | 0.877 MB/s | 0.635 MB/s | -0.7% | +37.1% |
| bs=1000 sw=10 sl=64 | p50 | 704,917 us | 692,696 us | 972,714 us | +1.8% | -27.5% |
| bs=1000 sw=10 sl=64 | p95 | 742,323 us | 725,950 us | 1,023,057 us | +2.3% | -27.4% |
| bs=1000 sw=10 sl=64 | p99 | 742,323 us | 725,950 us | 1,023,057 us | +2.3% | -27.4% |
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,366.34,200,128000,546,0.333,17499.00,25559.72,25559.72
1,100,10,64,20,1790.93,2000,1280000,1117,0.682,83956.62,207433.22,207433.22
2,1000,10,64,20,14013.20,20000,12800000,1427,0.871,704917.08,742322.75,742322.75eafce6d to
c009c34
Compare
7d88b62 to
1bf97cb
Compare
1bf97cb to
5f3afac
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…mponent Satisfies the rxjs-angular/prefer-takeuntil lint rule. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…mponent Fix setInterval/setTimeout leaks by tracking timer IDs and clearing them in ngOnDestroy. Remove takeUntil(destroy$) from shared module-level task fetch to prevent cache poisoning when the initiating component is destroyed. Remove unused TASK_TAG_MAP and TASK_NAMES exports. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…FaceComponent inFlightByTag was written but never read, so multiple component instances mounting for the same uncached task would each fire a full backend request. Add an in-flight guard that polls for the existing request's completion, matching the pattern already used for task fetches. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… in HuggingFaceComponent
Read X-Texera-Truncated header via { observe: "response" } to detect
when the backend's model list is incomplete. Show a notice prompting
users to search. When truncated, search queries are sent to the backend
search endpoint with debounce; otherwise local filtering is used.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…r lint rule Add back destroy$ and takeUntil(this.destroy$) on all subscribe calls. For the shared task fetch, add finalize() to reset tasksFetchSubscription when takeUntil fires before next/error, preventing the stale-guard bug the reviewer originally flagged. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…anup Mirror the defensive pattern from the tasks fetch so that when takeUntil(destroy$) cancels mid-flight, inFlightByTag is cleared and subsequent component instances can re-fetch instead of polling forever. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Elliot Lin <36275109+ELin2025@users.noreply.github.com>
- Fix model polling indefinite loop by detecting cancelled in-flight fetch - Fix CSS class mismatch: hf-tasks-error → hf-error to match SCSS - Remove unused imports in spec file Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Catch HTTP errors inside switchMap so search stream survives failures - Use empty string instead of null when clearing model selection Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Register the huggingface-audio-upload formly field type and declare HuggingFaceAudioUploadComponent in AppModule. Handles server-side audio storage via the /huggingface/upload-audio endpoint with local preview. Co-Authored-By: Anish Shivamurthy <anish@uci.edu>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… upload component Add early return in onFileSelected when isUploading is true to prevent race conditions from concurrent file selections. Remove the second spec test that had a dead metadata variable and duplicated the first test's assertion. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ponent Add meaningful tests: reject non-audio files, successful upload sets formControl value, and concurrent upload guard prevents race conditions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use preview URL as a token to detect if the user cleared during an in-flight upload and discard the stale response. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…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>
57f7306 to
bdcd1c8
Compare
Automated Reviewer SuggestionsBased on the
|
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 6a/6b 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 filledChanges to test infrastructure:
mockHuggingFaceSchemainmock-operator-metadata.data.ts(added tomockOperatorSchemaList)mockHuggingFacePredicateinmock-workflow-data.tsAny related issues, documentation, discussions?
How was this PR tested?
7 new spec tests added in
operator-property-edit-frame.component.spec.ts:text-generationreturns text-kind preview with correct titleimage-classificationreturns image-kind previewtext-to-speechreturns audio-kind previewtext-to-videoreturns video-kind previewRun with
ng test.Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.7