--- library_name: transformers pipeline_tag: text-to-audio tags: - music - text-to-music - musicgen - instrumental license: apache-2.0 --- # Instrumenta-2 Text-to-instrumental music generation model (up to 20 s, 32 kHz mono). Built on the MusicGen architecture (`MusicgenForConditionalGeneration`) and **trained from scratch** (~126M decoder parameters; using frozen `google-t5/t5-base` text encoder and `facebook/encodec_32khz` audio tokenizer components). ## Usage ```python from transformers import pipeline import scipy.io.wavfile as wav pipe = pipeline("text-to-audio", model="Maxilicious20/Instrumenta-2") out = pipe( "warm acoustic fingerstyle guitar with soft ambient strings", forward_params={"do_sample": True, "guidance_scale": 3.0, "max_new_tokens": 1003}, ) wav.write("output.wav", out["sampling_rate"], out["audio"].squeeze()) ``` `max_new_tokens=1003` corresponds to 20 s (`frames = max_new_tokens - 3` across 4 codebooks at 50 frames/s). ## Training - **Architecture:** Autoregressive 4-codebook Transformer decoder (~126M parameters) with T5-base cross-attention conditioning and a 32 kHz EnCodec audio tokenizer. - **Training Pipeline:** Two-stage training consisting of pretraining from scratch on instrumental audio clips followed by Supervised Fine-Tuning (SFT) on descriptive text-audio pairs. - **Hardware:** NVIDIA GeForce RTX 4060 (8 GB VRAM). ## Limitations - Maximum generation length of 20 s per pass; designed for instrumental music without vocals or multi-section song structures. - Specific tempo (BPM) or musical key instructions in prompts are only followed to a limited extent. ## License This model is released under the **Apache-2.0 License**. - Frozen backbone components: `google-t5/t5-base` (Apache-2.0) and `facebook/encodec_32khz`.