Upload processing_song2midi.py
Browse files- processing_song2midi.py +7 -1
processing_song2midi.py
CHANGED
|
@@ -62,7 +62,13 @@ class Song2MIDIProcessor(ProcessorMixin):
|
|
| 62 |
if input_data is not None and attribute is not None:
|
| 63 |
if attribute_name == "midi_tokenizer":
|
| 64 |
# Change the None to empty string to avoid errors in tokenizers when trying to tokenize None.
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
attribute_output = attribute(input_data, **kwargs[input_kwargs])
|
| 67 |
outputs[attribute_name] = attribute_output
|
| 68 |
|
|
|
|
| 62 |
if input_data is not None and attribute is not None:
|
| 63 |
if attribute_name == "midi_tokenizer":
|
| 64 |
# Change the None to empty string to avoid errors in tokenizers when trying to tokenize None.
|
| 65 |
+
if isinstance(input_data, (list, tuple)):
|
| 66 |
+
input_data = [
|
| 67 |
+
item if item is not None else "" for item in input_data
|
| 68 |
+
]
|
| 69 |
+
else:
|
| 70 |
+
input_data = input_data if input_data is not None else ""
|
| 71 |
+
|
| 72 |
attribute_output = attribute(input_data, **kwargs[input_kwargs])
|
| 73 |
outputs[attribute_name] = attribute_output
|
| 74 |
|