Downloads · 30 days
0
lluccardoner/melodyGPT-song-chords-tokenizer-1
melodyGPT-song-chords-tokenizer-1 is a machine learning model from lluccardoner. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
GPT2 tokenizer trained with a custom corpus of song chords: lluccardoner/melodyGPT-song-chords-text-1.
Downloads · 30 days
0
Access
Public
Updated Jul 5, 2024
Repo size
—
Likes
0
Public
Click a slice to open those files.
.json1.4 MB · 84%
From the Hugging Face model README
GPT2 tokenizer trained with a custom corpus of song chords: lluccardoner/melodyGPT-song-chords-text-1.
See melodyGPT repository.
from transformers import AutoTokenizer
gpt2_tokenizer = AutoTokenizer.from_pretrained("gpt2")
chords_gpt2_tokenizer = AutoTokenizer.from_pretrained("lluccardoner/melodyGPT-song-chords-tokenizer-1")
print(gpt2_tokenizer.vocab_size) # 50257
print(chords_gpt2_tokenizer.vocab_size) # 19972
example_chords = "Intro: Adim G7/13 Em Bb (4x) G#dim Bm/C F#m Ab|---------------------------------| (Bridge) C G Em7 Asus4"
tokens = gpt2_tokenizer.tokenize(example_chords)
# tokens: ['Int', 'ro', ':', 'ĠAd', 'im', 'ĠG', '7', '/', '13', 'ĠEm', 'ĠB', 'b', 'Ġ(', '4', 'x', ')', 'ĠG', '#', 'dim', 'ĠB', 'm', '/', 'C', 'ĠF', '#', 'm', 'ĠAb', '|', '--------------------------------', '-|', 'Ġ(', 'Bridge', ')', 'ĠC', 'ĠG', 'ĠEm', '7', 'ĠAsus', '4']
new_tokens = chords_gpt2_tokenizer.tokenize(example_chords)
# new_tokens: ['Intro', ':', 'ĠAdim', 'ĠG', '7', '/', '13', 'ĠEm', 'ĠBb', 'Ġ(', '4', 'x', ')', 'ĠG', '#', 'dim', 'ĠBm', '/', 'C', 'ĠF', '#', 'm', 'ĠAb', '|---------------------------------|', 'Ġ(', 'Bridge', ')', 'ĠC', 'ĠG', 'ĠEm', '7', 'ĠAsus', '4']