fix(amber, frontend): inline Hugging Face audio uploads as data URLs instead of a server temp file - #7790
fix(amber, frontend): inline Hugging Face audio uploads as data URLs instead of a server temp file#7790PG1204 wants to merge 7 commits into
Conversation
… the temp-file endpoints
Backport auto-label reportThis
|
Automated Reviewer SuggestionsBased on the
|
|
| 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 Report❌ Patch coverage is 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
*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:
|
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'saudioInputvalue, so it travels inside the workflow JSON and the generated Python's_read_audio_inputdecodes 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-recognitiontask, selecting an audio file shows an inline player and stores the value as adata:audio/…;base64,…URL (verified in the console). The size cap, invalid-file guard, and Clear button all behave as expected.Was this PR authored or co-authored using generative AI tooling?
Yes, this PR was co-authored with Claude in compliance with ASF policy.