Skip to content

GPT transformer from scratch, training to generate midi music , using Pytorch

Notifications You must be signed in to change notification settings

kvsnoufal/MidiTransformer

Repository files navigation

Generating Music with GPT

Coding up a GPT transformer from scratch, training to generate midi music.

Checkout Medium Article : https://medium.com/mlearning-ai/generating-music-with-gpt-b0f4ab738b58

In this article, I detail my learnings implementing a GPT model from scratch, training it for a custom use case - generating symbolic music.

Results

Embedded YouTube Video

I deployed the GPT model in flask and modified a cool midi player project I found on github (https://github.com/ryohey/signal) to complete input prompt music sequences. As evident from the video, they were not all winners 😜- some generations were horrifyingly repulsive. But in most cases, the model does a decent job.

GPT from scratch

Below is a diagram showing the Transformer -decorder architecture I implemented.

Image 1 GPT(Transformer-decoder architecture) - 2 Heads, 1 Layer.

Image 2 Tiny Stories completion.

There is a lot of room for improvement here to get better results. My intention here was to learn and get a much more hands on experience with foundation model, and build something cool in the process. 

Shoulders of Giants

About

GPT transformer from scratch, training to generate midi music , using Pytorch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published