feat(frontend): add HuggingFace audio upload component#5567
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5567 +/- ##
============================================
- Coverage 54.09% 53.65% -0.44%
- Complexity 2817 2821 +4
============================================
Files 1103 1108 +5
Lines 42650 43163 +513
Branches 4588 4672 +84
============================================
+ Hits 23070 23158 +88
- Misses 18236 18654 +418
- Partials 1344 1351 +7
*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:
|
Ma77Ball
left a comment
There was a problem hiding this comment.
Left Comments, please address or give reply.
d8cb4ef to
df965e5
Compare
|
| config | throughput | MB/s | latency | max Δ latest / 7d | |
|---|---|---|---|---|---|
| 🔴 | bs=10 sw=10 sl=64 | 362 | 0.221 | 24,984/45,717/45,717 us | 🔴 +21.2% / 🔴 +30.7% |
| 🔴 | bs=100 sw=10 sl=64 | 800 | 0.488 | 123,620/146,559/146,559 us | 🔴 +8.8% / 🔴 -10.4% |
| ⚪ | bs=1000 sw=10 sl=64 | 907 | 0.554 | 1,102,403/1,144,846/1,144,846 us | ⚪ within ±5% / 🔴 +13.3% |
Baseline details
Latest main 8803d08 from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---|---|---|---|---|
| bs=10 sw=10 sl=64 | throughput | 362 tuples/sec | 412 tuples/sec | 410.82 tuples/sec | -12.1% | -11.9% |
| bs=10 sw=10 sl=64 | MB/s | 0.221 MB/s | 0.251 MB/s | 0.251 MB/s | -12.0% | -11.9% |
| bs=10 sw=10 sl=64 | p50 | 24,984 us | 21,211 us | 23,785 us | +17.8% | +5.0% |
| bs=10 sw=10 sl=64 | p95 | 45,717 us | 37,707 us | 34,980 us | +21.2% | +30.7% |
| bs=10 sw=10 sl=64 | p99 | 45,717 us | 37,707 us | 34,980 us | +21.2% | +30.7% |
| bs=100 sw=10 sl=64 | throughput | 800 tuples/sec | 816 tuples/sec | 891.94 tuples/sec | -2.0% | -10.3% |
| bs=100 sw=10 sl=64 | MB/s | 0.488 MB/s | 0.498 MB/s | 0.544 MB/s | -2.0% | -10.4% |
| bs=100 sw=10 sl=64 | p50 | 123,620 us | 122,723 us | 112,277 us | +0.7% | +10.1% |
| bs=100 sw=10 sl=64 | p95 | 146,559 us | 134,725 us | 139,802 us | +8.8% | +4.8% |
| bs=100 sw=10 sl=64 | p99 | 146,559 us | 134,725 us | 139,802 us | +8.8% | +4.8% |
| bs=1000 sw=10 sl=64 | throughput | 907 tuples/sec | 917 tuples/sec | 1,041 tuples/sec | -1.1% | -12.9% |
| bs=1000 sw=10 sl=64 | MB/s | 0.554 MB/s | 0.559 MB/s | 0.635 MB/s | -0.9% | -12.8% |
| bs=1000 sw=10 sl=64 | p50 | 1,102,403 us | 1,093,013 us | 972,714 us | +0.9% | +13.3% |
| bs=1000 sw=10 sl=64 | p95 | 1,144,846 us | 1,141,167 us | 1,023,057 us | +0.3% | +11.9% |
| bs=1000 sw=10 sl=64 | p99 | 1,144,846 us | 1,141,167 us | 1,023,057 us | +0.3% | +11.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,553.19,200,128000,362,0.221,24984.30,45717.03,45717.03
1,100,10,64,20,2500.43,2000,1280000,800,0.488,123619.63,146559.19,146559.19
2,1000,10,64,20,22039.18,20000,12800000,907,0.554,1102402.64,1144846.05,1144846.05e5ac4ef to
e3a3335
Compare
Ma77Ball
left a comment
There was a problem hiding this comment.
LGTM. All prior comments resolved:
- re-entry guard (if (this.isUploading) return;) added to onFileSelected
- spec now real TestBed coverage (rejects non-audio, uploads + sets formControl, guards concurrent uploads); dead metadata variable removed
No other issues. Static review only, not built or run.
@xuang7 can you review.
fa99eb7 to
a61374f
Compare
a61374f to
fa99eb7
Compare
5dfd213 to
bc8383d
Compare
…nent Register the huggingface formly field type and declare HuggingFaceComponent in AppModule. Provides a task dropdown, paginated model list with client-side search, and per-task field state preservation when switching tasks.
The rxjs/no-implicit-any-catch ESLint rule requires explicit type annotations on error callbacks in .subscribe() calls. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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>
6ccb34a to
2a7ac1d
Compare
Automated Reviewer SuggestionsBased on the
|
What changes were proposed in this PR?
Add
HuggingFaceAudioUploadComponent, a custom formly field type (huggingface-audio-upload) that provides:/huggingface/upload-audioendpoint for server-side storageThis PR registers the component in
formly-config.tsand declares it inAppModule. The component is not yet wired into the HuggingFace operator's property editor; thejsonSchemaMapInterceptmapping that routes theaudioInputfield to this component is added in the follow-up property-editor PR (PR 7).Any related issues, documentation, discussions?
How was this PR tested?
2 unit tests added in
hugging-face-audio-upload.component.spec.tsverifying the component class is defined and importable. Run withng test.Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.7