Skip to content

fix(amber, frontend): inline Hugging Face audio uploads as data URLs instead of a server temp file - #7790

Open
PG1204 wants to merge 7 commits into
apache:mainfrom
PG1204:fix/hf-audio-upload
Open

fix(amber, frontend): inline Hugging Face audio uploads as data URLs instead of a server temp file#7790
PG1204 wants to merge 7 commits into
apache:mainfrom
PG1204:fix/hf-audio-upload

Conversation

@PG1204

@PG1204 PG1204 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

The Hugging Face operator's Audio Upload widget now captures the selected file entirely in the browser and stores it as a self-contained data:audio/…;base64,… URL, instead of relying on a server-side temp file.

Previously the upload ended up as a server-side temp file reference. In a distributed deployment the Python worker that runs the inference is a different process than the web server, so it could not read that path, the uploaded audio never reached the model. The widget now reads the file client-side (FileReader.readAsDataURL) and stores the data URL as the operator's audioInput value, so it travels inside the workflow JSON and the generated Python's _read_audio_input decodes it directly. This mirrors the existing Image Upload widget's data-URL approach.

A 25 MB size cap and input guards ("Choose an audio file.", "Audio file is too large (max 25 MB).", "Could not read this audio file.") are added since base64 inlining bloats the workflow JSON, along with an inline <audio> preview and a Clear button.

Any related issues?

Closes #6968

How was this PR tested?

Frontend unit tests, plus a manual UI check: on the automatic-speech-recognition task, selecting an audio file shows an inline player and stores the value as a data:audio/…;base64,… URL (verified in the console). The size cap, invalid-file guard, and Clear button all behave as expected.

image

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

Yes, this PR was co-authored with Claude in compliance with ASF policy.

@github-actions github-actions Bot added engine fix frontend Changes related to the frontend GUI labels Aug 19, 2026
@Yicong-Huang Yicong-Huang added the release/v1.2 back porting to release/v1.2 label Aug 19, 2026
@github-actions
github-actions Bot requested a review from xuang7 August 19, 2026 22:31
@github-actions

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. release/* labels drive the post-merge backport, so add or remove one to change where this fix lands.

Release branch Analysis
release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. Requested review from @xuang7.

Auto-label run.

@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: @ELin2025, @aglinxinyuan, @juliethecao
    You can notify them by mentioning @ELin2025, @aglinxinyuan, @juliethecao in a comment.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main c927890 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 485 0.296 17,802/51,753/51,753 us 🔴 +100.3% / 🔴 +231.9%
🔴 bs=100 sw=10 sl=64 1,227 0.749 78,387/108,065/108,065 us 🔴 +8.4% / 🟢 +23.1%
🟢 bs=1000 sw=10 sl=64 1,430 0.873 700,537/740,069/740,069 us 🟢 -6.8% / 🟢 +37.9%
Baseline details

Latest main c927890 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 485 tuples/sec 567 tuples/sec 771.02 tuples/sec -14.5% -37.1%
bs=10 sw=10 sl=64 MB/s 0.296 MB/s 0.346 MB/s 0.471 MB/s -14.5% -37.1%
bs=10 sw=10 sl=64 p50 17,802 us 18,688 us 12,749 us -4.7% +39.6%
bs=10 sw=10 sl=64 p95 51,753 us 25,836 us 15,594 us +100.3% +231.9%
bs=10 sw=10 sl=64 p99 51,753 us 25,836 us 19,320 us +100.3% +167.9%
bs=100 sw=10 sl=64 throughput 1,227 tuples/sec 1,219 tuples/sec 997.05 tuples/sec +0.7% +23.1%
bs=100 sw=10 sl=64 MB/s 0.749 MB/s 0.744 MB/s 0.609 MB/s +0.7% +23.1%
bs=100 sw=10 sl=64 p50 78,387 us 81,813 us 100,339 us -4.2% -21.9%
bs=100 sw=10 sl=64 p95 108,065 us 99,697 us 106,781 us +8.4% +1.2%
bs=100 sw=10 sl=64 p99 108,065 us 99,697 us 113,101 us +8.4% -4.5%
bs=1000 sw=10 sl=64 throughput 1,430 tuples/sec 1,401 tuples/sec 1,037 tuples/sec +2.1% +37.9%
bs=1000 sw=10 sl=64 MB/s 0.873 MB/s 0.855 MB/s 0.633 MB/s +2.1% +37.9%
bs=1000 sw=10 sl=64 p50 700,537 us 715,645 us 971,388 us -2.1% -27.9%
bs=1000 sw=10 sl=64 p95 740,069 us 794,037 us 1,013,249 us -6.8% -27.0%
bs=1000 sw=10 sl=64 p99 740,069 us 794,037 us 1,039,879 us -6.8% -28.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,412.37,200,128000,485,0.296,17802.47,51753.00,51753.00
1,100,10,64,20,1630.27,2000,1280000,1227,0.749,78386.87,108064.75,108064.75
2,1000,10,64,20,13984.42,20000,12800000,1430,0.873,700536.53,740069.14,740069.14

@codecov-commenter

codecov-commenter commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.10345% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.24%. Comparing base (c927890) to head (04a8320).

Files with missing lines Patch % Lines
...io-upload/hugging-face-audio-upload.component.html 0.00% 0 Missing and 1 partial ⚠️
...udio-upload/hugging-face-audio-upload.component.ts 96.42% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7790      +/-   ##
============================================
- Coverage     91.25%   91.24%   -0.02%     
+ Complexity     4471     4457      -14     
============================================
  Files          1171     1171              
  Lines         47124    46999     -125     
  Branches       5286     5260      -26     
============================================
- Hits          43003    42882     -121     
+ Misses         2447     2444       -3     
+ Partials       1674     1673       -1     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from c927890
agent-service 98.62% <ø> (ø) Carriedforward from c927890
amber 87.96% <ø> (-0.06%) ⬇️
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from c927890
config-service 86.73% <ø> (ø) Carriedforward from c927890
file-service 68.90% <ø> (ø) Carriedforward from c927890
frontend 92.63% <93.10%> (+<0.01%) ⬆️
notebook-migration-service 83.74% <ø> (ø) Carriedforward from c927890
pyamber 97.57% <ø> (ø) Carriedforward from c927890
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from c927890

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

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

Labels

engine fix frontend Changes related to the frontend GUI release/v1.2 back porting to release/v1.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HuggingFace inference operator: uploaded audio is stored as a server temp path that the Python worker refuses to read, so audio upload never works

3 participants