Katsukuten/Harmonia-LM ? reverse-engineered prompt

Reverse engineered prompt

Build me a MIDI music generation project that can train and sample a causal language model on a MIDI dataset.

I want it to take raw MIDI files, convert them into tokens with a MIDI tokenizer, split them into fixed length chunks, and cache the processed data so training is fast. Then train a Hugging Face compatible causal LM with a PyTorch Lightning style workflow, save the best checkpoint, and support simple inference where I can give a short primer MIDI and get a continuation back as a new MIDI file.

It should work with models like Qwen3 or any other causal model from Transformers, and it should include sensible generation settings for music, like low temperature, a small repetition penalty, and top p sampling. If possible, add a basic notebook or demo script so I can try training and generation end to end with the included sample MIDI files or the MAESTRO dataset. Look up current docs online if you need to.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab