Skip to content

Add HuggingFace audio and media generation tasks #5288

Closed

Description

@anishshiva7

Task Summary

Feature Summary

The HuggingFace inference operator (#5041) is being landed as a sequence of focused task-family PRs. The dispatcher + per-task codegen architecture was introduced in #5277 with text-generation as the first task family.

This issue covers adding the audio and media-generation task families to that architecture. The new tasks plug into the existing dispatcher by adding dedicated TaskCodegen implementations for audio and media generation, then registering their task strings in HuggingFaceInferenceOpDesc.

Concretely, landing this would enable:

  • Audio inference tasks:
    • automatic-speech-recognition
    • audio-classification
    • text-to-speech
  • Media-generation tasks:
    • text-to-image
    • text-to-video
  • A cleaner codegen structure where audio and media-generation Python payload / parse logic lives in separate files instead of expanding the operator descriptor.

Proposed Solution or Design

Add new files under:

common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/huggingFace/codegen/

File Purpose
AudioTaskCodegen.scala Payload and response parsing for ASR, audio-classification, and text-to-speech
MediaGenCodegen.scala Payload and response parsing for text-to-image and text-to-video

Modify:

File Change
HuggingFaceInferenceOpDesc.scala Add audio input fields and register the new task codegens
TaskCodegen.scala Extend CodegenContext with audio input fields
PythonCodegenBase.scala Add shared audio/media helpers, audio source resolution, raw audio body support, and media data URL handling
HuggingFaceInferenceOpDescSpec.scala Add descriptor/codegen coverage for audio and media-generation tasks

Design constraints:

  • Follow the dispatcher pattern from Add HuggingFaceInferenceOpDesc with dispatcher + per-task codegen architecture (text-generation) #5277.
  • Keep task-specific Python generation in separate TaskCodegen files.
  • Preserve EncodableString + pyb"..." safety for user-provided string fields.
  • Keep generatePythonCode total so arbitrary @JsonProperty values do not throw during code generation.
  • Normalize media responses into data URLs where applicable so downstream result rendering can consume image, audio, and video outputs consistently.

References:

Impact / Priority

(P2) Medium — required for broader HuggingFace operator task coverage. Does not affect existing operators.

Affected Area

Workflow Engine (Amber) — HuggingFace operator descriptor and Python codegen.

Task Type

Testing / QA

Other

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Activity

  1. added theissue type on May 29, 2026
  2. github-actions commented on May 29, 2026

    @github-actions
    Contributor

    👋 Thanks for your first contribution to Texera, @anishshiva7!

    You can drive common housekeeping tasks just by leaving a comment. Type the command on its own line.

    On issues

    Command What it does
    /take Assign the issue to yourself (self-claim it)
    /untake Remove yourself as assignee

    To find unclaimed work, search is:issue is:open no:assignee — there's no "triage" label; the search filter is the triage state.

    Linking sub-issues

    Command Where to run it What it does
    /sub-issue #12 #13 On the parent Links #12 and #13 as children of this issue
    /unsub-issue #12 #13 On the parent Unlinks those children
    /parent-issue #5 On the child Sets #5 as this issue's parent
    /unparent-issue On the child Removes this issue's parent (auto-detected)
    /unparent-issue #5 On the child Removes parent #5 explicitly

    You can write references as #12 or bare 12. Cross-repo references like owner/repo#12 aren't supported and are ignored.

    On pull requests (author only)

    Command What it does
    /request-review @user [@user ...] Request reviews from those users
    /unrequest-review @user [@user ...] Cancel those review requests

    You can mention teams as @org/team, and @copilot works too. Only the PR author can use these commands.

    Note: Commands must match exactly — /take this won't work, only /take. Bots are ignored, and you can't self-link an issue or set an issue as its own parent.

    For the full contribution flow, see CONTRIBUTING.md.

  3. anishshiva7 commented on May 29, 2026

    @anishshiva7
    ContributorAuthor

    /take

  4. Ma77Ball commented on May 29, 2026

    @Ma77Ball
    Contributor

    /parent-issue #5041

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions