from transformers import AutoModelForCausalLM, AutoTokenizerm = "Prompt48/Qwen3-8B-MiMo-Music-GRPO"tok = AutoTokenizer.from_pretrained(m); model = AutoModelForCausalLM.from_pretrained(m, torch_dtype="auto", device_map="auto")msgs = [{"role": "system", "content": "You are a composer. Reply with one complete piece in ABC notation inside a ```abc code block. Start with X:1 and include T:, M:, L:, Q:, K: headers."}, {"role": "user", "content": "Compose a Viennese waltz in Eb major, 181 BPM allegro, 3/4, about 96 bars and about three and a half minutes, scored for strings and harp in 4 voices. Texture: a slightly anticipated waltz bass under an elegant sweeping tune. Open with 8 bars of strings alone, then layer the other parts in one at a time. The main section runs on a 4-bar diatonic loop of I–IV–V–I, unchanged throughout. Thin the middle section to two voices for two descending phrases, then return with everything for the fullest passage. Dynamics start at p, push to mf in the middle and settle back to p for a sustained tonic close. Aim for the feeling of a rooftop above neon. Use no ornament symbols; write every note out. Output the complete piece as ABC notation."}]ids = tok.apply_chat_template(msgs, add_generation_prompt=True, enable_thinking=False, return_tensors="pt").to(model.device)print(tok.decode(model.generate(ids, max_new_tokens=2048, do_sample=True, temperature=1.0)[0][ids.shape[1]:]))