Downloads · 30 days
0
nagoshidayo/MORTM
MORTM is a machine learning model from nagoshidayo. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
MORTM is a Transformer-based model designed for melody generation, with a strong emphasis on metric (rhythmic) structure. It represents music as sequences of pitch, duration, and relative beat positions within a measu…
Downloads · 30 days
0
Access
Public
Updated Jun 16, 2025
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md3.5 KB · 70%
From the Hugging Face model README
MORTM is a Transformer-based model designed for melody generation, with a strong emphasis on metric (rhythmic) structure. It represents music as sequences of pitch, duration, and relative beat positions within a measure (normalized to 96 ticks), making it suitable for time-robust, rhythm-aware music generation tasks.
This modelcard aims to be a base template for new models. It has been generated using this raw template.
MORTM (Metric-Oriented Rhythmic Transformer for Melodic generation) is a decoder-only Transformer architecture optimized for music generation with rhythmic awareness. It generates melodies measure-by-measure in an autoregressive fashion. The model supports chord-conditional generation and is equipped with the following features:
Mixture of Experts (MoE) in the feedforward layers for capacity increase and compute efficiency.
ALiBi (Attention with Linear Biases) for relative positional biasing.
FlashAttention2 for fast and memory-efficient attention.
Relative tick-based tokenization (e.g., [Position, Duration, Pitch]) for metric robustness.
Developed by: Koue Okazaki & Takaki Nagoshi
Funded by [optional]: Nihon University, Graduate School of Integrated Basic Sciences
Shared by [optional]: ProjectMORTM
Model type: Transformer (decoder-only with MoE and ALiBi)
Language(s) (NLP): N/A (music domain)
License: MIT
Finetuned from model [optional]: Custom-built from scratch (not fine-tuned from a pretrained LM)
MORTM can generate melodies from scratch or conditionally based on chord progressions. It is ideal for:
As the training dataset is primarily composed of Western tonal music, the model may underperform on:
Generated melodies should be manually reviewed in professional music contexts. Users are encouraged to retrain or fine-tune on representative datasets when applying to culturally specific music.
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("nagoshidayo/mortm")
tokenizer = AutoTokenizer.from_pretrained("nagoshidayo/mortm")