Instructions to use B-K/song2midi-processor with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use B-K/song2midi-processor with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("B-K/song2midi-processor", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload tokenization_song2midi.py
Browse files
midi_tokenizer/tokenization_song2midi.py
CHANGED
|
@@ -140,7 +140,7 @@ class Song2MIDIPerTokTokenizer(PythonBackend):
|
|
| 140 |
"Input must be a Score, a path to a MIDI file, or a list of token IDs."
|
| 141 |
)
|
| 142 |
|
| 143 |
-
first_ids = get_input_ids(midi)
|
| 144 |
second_ids = get_input_ids(midi_pair) if midi_pair is not None else None
|
| 145 |
|
| 146 |
return self.prepare_for_model(
|
|
|
|
| 140 |
"Input must be a Score, a path to a MIDI file, or a list of token IDs."
|
| 141 |
)
|
| 142 |
|
| 143 |
+
first_ids = get_input_ids(midi) if midi is not None else []
|
| 144 |
second_ids = get_input_ids(midi_pair) if midi_pair is not None else None
|
| 145 |
|
| 146 |
return self.prepare_for_model(
|