Skip to content

fegounna/LLM-Fine-Tuning-for-Music-Generation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Llama2 Music Generation

For more details : https://medium.com/@yassin.moakher/fine-tuning-llm-for-music-generation-480ca97bf22d

This repository focuses on fine-tuning Llama2 for music generation tasks. The process involves converting MIDI files to a text-based representation using midi_textefinal.py script. The text representation encodes musical notes as quadruplets, where each variable is separated by a colon (:). Within each quadruplet, the four variables represent:

  • p: Pitch
  • v: Velocity
  • d: Duration
  • t: Time

After converting MIDI files to text, we proceed to fine-tune the Llama2 model for improved music generation performance.

Usage

Converting a MIDI File to Text Representation

To convert a MIDI file to text format, use the midi_textefinal.py

Converting Text to MIDI File

To convert text to a MIDI file, use the text_to_midi.py

Generating Music

Examples

extrait-3.mp4
song-22.mp4
WhatsApp-Audio-2024-05-16-at-114.mp4
WhatsApp-Audio-2024-04-25-at-122.mp4
song-21.mp4
song-5.mp4

Acknowledgments

  • Special thanks to our tutor, Ghadjeres, for his guidance and support throughout this project.

Contributors

  • Yessin Moakher (fegounna)
  • Marc Janthial (EchoSlash)
  • Charles Benichou--chaffanjon (chafflarch)
  • Cyprien Laruelle
  • Jules Cognon
  • Damien Fromilhague