PG1204 opened a new pull request, #7790:
URL: https://github.com/apache/texera/pull/7790
### 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.
<img width="1275" height="549" alt="image"
src="https://github.com/user-attachments/assets/2c43240d-86a8-4b64-9063-89a568a5444a"
/>
### Was this PR authored or co-authored using generative AI tooling?
Yes, this PR was co-authored with Claude in compliance with ASF policy.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]