Skip to content

Add AudioGen (AudioCraft) to MusicGen conversion scripts - #45382

Closed
zFlux wants to merge 1 commit into
huggingface:mainfrom
zFlux:add-audiogen-audiocraft-conversion
Closed

zFlux wants to merge 1 commit into
huggingface:mainfrom
zFlux:add-audiogen-audiocraft-conversion

Conversation

@zFlux

@zFlux zFlux commented Apr 12, 2026

Copy link
Copy Markdown

Summary

Adds conversion from facebook/audiogen-medium (AudioCraft Hub layout: state_dict.bin + compression_state_dict.bin) to MusicgenForConditionalGeneration.

  • convert_audiogen_transformers.py — reuses rename_state_dict from convert_musicgen_transformers.py
  • encodec_audiocraft_to_hf.py — maps AudioCraft EnCodec weights to HF EncodecModel (16 kHz, ratios [8,5,4,2])
  • Docs: AudioGen subsection in model_doc/musicgen.md

Runtime deps for the script: pip install omegaconf (no audiocraft required).

Motivation

Enables the same downstream path as MusicGen: Optimum ONNX → Transformers.js.


Fork branch: https://github.com/zFlux/transformers/tree/add-audiogen-audiocraft-conversion

Made with Cursor

- encodec_audiocraft_to_hf: map facebook/audiogen-medium compression checkpoint to EncodecModel
- convert_audiogen_transformers: assemble MusicgenForConditionalGeneration from Hub LM + compression shards
- Document conversion in musicgen.md (requires omegaconf)

Made-with: Cursor
@github-actions

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: musicgen

@ArthurZucker

Copy link
Copy Markdown
Collaborator

Closing this one: no activity since 2026-04-12, 2 of the 3 files it changes no longer exist on main. Thanks for the contribution, and feel free to open a fresh PR against main if it's still relevant!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants