Skip to content

feat(frontend): add HuggingFace audio upload component#5567

Open
ELin2025 wants to merge 25 commits into
apache:mainfrom
ELin2025:hf/06b-audio-upload
Open

feat(frontend): add HuggingFace audio upload component#5567
ELin2025 wants to merge 25 commits into
apache:mainfrom
ELin2025:hf/06b-audio-upload

Conversation

@ELin2025

@ELin2025 ELin2025 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ This PR is stacked on #5566. Until that lands, the diff below may also include PR 6a's task selector + model browser changes depending on which base GitHub is showing. The new code in this PR is the HuggingFaceAudioUploadComponent under frontend/src/app/workspace/component/hugging-face-audio-upload/, plus the formly registration in formly-config.ts and the declaration in app.module.ts. Once PR 6a merges and this PR is retargeted to main, the diff should auto-clean to the PR #5566 audio upload changes only.

What changes were proposed in this PR?

Add HuggingFaceAudioUploadComponent, a custom formly field type (huggingface-audio-upload) that provides:

  • An audio file picker that uploads to the Texera backend's /huggingface/upload-audio endpoint for server-side storage
  • Local audio preview/playback using a browser Object URL while upload is in progress
  • Storage of the returned server path in the formly form control
  • A guidance message explaining why audio is uploaded to backend storage rather than embedded in the workflow JSON

This PR registers the component in formly-config.ts and declares it in AppModule. The component is not yet wired into the HuggingFace operator's property editor; the jsonSchemaMapIntercept mapping that routes the audioInput field 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.ts verifying the component class is defined and importable. Run with ng test.

Was this PR authored or co-authored using generative AI tooling?

Co-authored with Claude Opus 4.7

@github-actions github-actions Bot added frontend Changes related to the frontend GUI common labels Jun 8, 2026
@codecov-commenter

codecov-commenter commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 18.05825% with 422 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.65%. Comparing base (439ea72) to head (2a7ac1d).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...e/component/hugging-face/hugging-face.component.ts 7.26% 267 Missing and 1 partial ⚠️
...component/hugging-face/hugging-face.component.html 0.00% 96 Missing ⚠️
...udio-upload/hugging-face-audio-upload.component.ts 44.44% 35 Missing and 5 partials ⚠️
...io-upload/hugging-face-audio-upload.component.html 28.00% 18 Missing ⚠️
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     
Flag Coverage Δ *Carryforward flag
access-control-service 70.44% <ø> (ø)
agent-service 34.36% <ø> (ø) Carriedforward from c5f75b9
amber 55.67% <100.00%> (+0.05%) ⬆️
computing-unit-managing-service 1.65% <ø> (ø)
config-service 57.35% <ø> (ø)
file-service 58.59% <ø> (ø)
frontend 47.13% <12.80%> (-0.96%) ⬇️
pyamber 90.20% <ø> (ø) Carriedforward from c5f75b9
python 90.76% <ø> (ø) Carriedforward from c5f75b9
workflow-compiling-service 58.69% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Ma77Ball Ma77Ball left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left Comments, please address or give reply.

@ELin2025 ELin2025 force-pushed the hf/06b-audio-upload branch from d8cb4ef to df965e5 Compare June 11, 2026 23:38
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 0 better · 🔴 7 worse · ⚪ 8 noise (<±5%) · 0 without baseline

Compared against main 8803d08 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

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.05

@ELin2025 ELin2025 force-pushed the hf/06b-audio-upload branch from e5ac4ef to e3a3335 Compare June 11, 2026 23:52
@ELin2025 ELin2025 requested a review from Ma77Ball June 12, 2026 00:21

@Ma77Ball Ma77Ball left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ELin2025 ELin2025 force-pushed the hf/06b-audio-upload branch 2 times, most recently from fa99eb7 to a61374f Compare June 16, 2026 18:08
@github-actions github-actions Bot added engine dependencies Pull requests that update a dependency file pyamber ci changes related to CI docs Changes related to documentations dev platform Non-amber Scala service paths agent-service labels Jun 16, 2026
@ELin2025 ELin2025 force-pushed the hf/06b-audio-upload branch from a61374f to fa99eb7 Compare June 16, 2026 18:14
@github-actions github-actions Bot removed engine dependencies Pull requests that update a dependency file pyamber ci changes related to CI docs Changes related to documentations dev platform Non-amber Scala service paths agent-service labels Jun 16, 2026
@ELin2025 ELin2025 force-pushed the hf/06b-audio-upload branch 2 times, most recently from 5dfd213 to bc8383d Compare June 20, 2026 00:31
anishshiva7 and others added 25 commits June 22, 2026 21:58
…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>
@ELin2025 ELin2025 force-pushed the hf/06b-audio-upload branch from 6ccb34a to 2a7ac1d Compare June 23, 2026 16:33
@github-actions github-actions Bot removed the engine label Jun 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @anishshiva7, @Ma77Ball, @PG1204
    You can notify them by mentioning @anishshiva7, @Ma77Ball, @PG1204 in a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add HuggingFace task selector, model browser, and audio upload components

5 participants