Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pipeline_tag: MIDI or Chord to MIDI or Chord
|
| 3 |
+
tags:
|
| 4 |
+
- music-generation
|
| 5 |
+
- transformer
|
| 6 |
+
- MoE
|
| 7 |
+
- ALiBi
|
| 8 |
+
- FlashAttention
|
| 9 |
+
- melody-generation
|
| 10 |
+
- rhythmic-modeling
|
| 11 |
+
---
|
| 12 |
+
# Model Card for MORTM (Metric-Oriented Rhythmic Transformer for Melodic generation)
|
| 13 |
+
|
| 14 |
+
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.
|
| 15 |
+
|
| 16 |
+
This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
|
| 17 |
+
|
| 18 |
+
## Model Details
|
| 19 |
+
|
| 20 |
+
### Model Description
|
| 21 |
+
|
| 22 |
+
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:
|
| 23 |
+
|
| 24 |
+
- Mixture of Experts (MoE) in the feedforward layers for capacity increase and compute efficiency.
|
| 25 |
+
- ALiBi (Attention with Linear Biases) for relative positional biasing.
|
| 26 |
+
- FlashAttention2 for fast and memory-efficient attention.
|
| 27 |
+
- Relative tick-based tokenization (e.g., [Position, Duration, Pitch]) for metric robustness.
|
| 28 |
+
|
| 29 |
+
- **Developed by:** Koue Okazaki & Takaki Nagoshi
|
| 30 |
+
- **Funded by [optional]:** Nihon University, Graduate School of Integrated Basic Sciences
|
| 31 |
+
- **Shared by [optional]:** ProjectMORTM
|
| 32 |
+
- **Model type:** Transformer (decoder-only with MoE and ALiBi)
|
| 33 |
+
- **Language(s) (NLP):** N/A (music domain)
|
| 34 |
+
- **License:** MIT
|
| 35 |
+
- **Finetuned from model [optional]:** Custom-built from scratch (not fine-tuned from a pretrained LM)
|
| 36 |
+
|
| 37 |
+
### Model Sources [optional]
|
| 38 |
+
|
| 39 |
+
- **Repository:** [https://github.com/Ayato964/MORTM](https://github.com/Ayato964/MORTM) *(replace with actual link)*
|
| 40 |
+
- **Paper [optional]:** In submission
|
| 41 |
+
- **Demo [optional]:** Coming soon
|
| 42 |
+
|
| 43 |
+
## Uses
|
| 44 |
+
|
| 45 |
+
### Direct Use
|
| 46 |
+
|
| 47 |
+
MORTM can generate melodies from scratch or conditionally based on chord progressions. It is ideal for:
|
| 48 |
+
|
| 49 |
+
- Melody composition in pop, jazz, and improvisational styles.
|
| 50 |
+
- Real-time melodic suggestion systems for human-AI co-creation.
|
| 51 |
+
- Music education and melody completion tools.
|
| 52 |
+
|
| 53 |
+
### Downstream Use [optional]
|
| 54 |
+
|
| 55 |
+
- Style transfer with different chord inputs.
|
| 56 |
+
- Harmonization and rhythm-based accompaniment systems.
|
| 57 |
+
|
| 58 |
+
### Out-of-Scope Use
|
| 59 |
+
|
| 60 |
+
- Audio-to-audio tasks (e.g., vocal separation).
|
| 61 |
+
- Raw audio synthesis (requires additional vocoder).
|
| 62 |
+
- Not suitable for genre classification or music recommendation.
|
| 63 |
+
|
| 64 |
+
## Bias, Risks, and Limitations
|
| 65 |
+
|
| 66 |
+
As the training dataset is primarily composed of Western tonal music, the model may underperform on:
|
| 67 |
+
|
| 68 |
+
- Non-tonal, microtonal, or traditional music styles.
|
| 69 |
+
- Polyrhythmic or tempo-variable music.
|
| 70 |
+
- Genres not sufficiently represented in training data (e.g., Indian classical).
|
| 71 |
+
|
| 72 |
+
### Recommendations
|
| 73 |
+
|
| 74 |
+
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.
|
| 75 |
+
|
| 76 |
+
## How to Get Started with the Model
|
| 77 |
+
|
| 78 |
+
```python
|
| 79 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 80 |
+
|
| 81 |
+
model = AutoModelForCausalLM.from_pretrained("nagoshidayo/mortm")
|
| 82 |
+
tokenizer = AutoTokenizer.from_pretrained("nagoshidayo/mortm")
|