Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
|
|
2 |
import note_seq
|
3 |
import numpy as np
|
4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
|
5 |
|
6 |
tokenizer = AutoTokenizer.from_pretrained("Katpeeler/lmd_8bars_tokenizer")
|
7 |
model = AutoModelForCausalLM.from_pretrained("Katpeeler/midi_model_1")
|
@@ -10,7 +11,7 @@ NOTE_LENGTH_16TH_120BPM = 0.25 * 60 / 120
|
|
10 |
BAR_LENGTH_120BPM = 4.0 * 60 / 120
|
11 |
SAMPLE_RATE=44100
|
12 |
|
13 |
-
def token_sequence_to_note_sequence(token_sequence, use_program=True, use_drums=True, instrument_mapper=
|
14 |
if isinstance(token_sequence, str):
|
15 |
token_sequence = token_sequence.split()
|
16 |
note_sequence = empty_note_sequence()
|
|
|
2 |
import note_seq
|
3 |
import numpy as np
|
4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
5 |
+
from constants import GM_INSTRUMENTS
|
6 |
|
7 |
tokenizer = AutoTokenizer.from_pretrained("Katpeeler/lmd_8bars_tokenizer")
|
8 |
model = AutoModelForCausalLM.from_pretrained("Katpeeler/midi_model_1")
|
|
|
11 |
BAR_LENGTH_120BPM = 4.0 * 60 / 120
|
12 |
SAMPLE_RATE=44100
|
13 |
|
14 |
+
def token_sequence_to_note_sequence(token_sequence, use_program=True, use_drums=True, instrument_mapper=GM_INSTRUMENTS[], only_piano=False):
|
15 |
if isinstance(token_sequence, str):
|
16 |
token_sequence = token_sequence.split()
|
17 |
note_sequence = empty_note_sequence()
|