Views
No views yet
config.json — Model configuration (includes t5_model_name reference)model.safetensors — LM + EnCodec weightsmodel.safetensors.index.json — Weight index (for sharded variants)extract_t5.py to extract them from the original facebook/audiogen-medium checkpoint:python extract_t5.py --output /path/to/audiogen-mlx/t5t5/ directory with config.json, model.safetensors, and tokenizer files.Note: The T5 safetensors keys use MLX-compatible naming (.layer_0./.layer_1.instead of HuggingFace's.layer.0./.layer.1.). This is required because MLX'sModuleParameters.unflattened()splits on all dots.
1import MLXAudioGen
2
3let model = try await AudioGenModel.fromPretrained(
4 modelFolder: modelURL,
5 t5Folder: t5URL
6)
7
8let tokens = try await model.generate(
9 descriptions: ["dog barking"],
10 duration: 5.0,
11 cfgCoef: 3.0,
12 temperature: 1.0,
13 topK: 250
14)
15
16let audio = model.decode(tokens: tokens)1/sqrt(d_k). This is a deliberate design choice in the T5 architecture — do not add scaling in the inference code.