B-K commited on
Commit
360c9f3
·
verified ·
1 Parent(s): 7873058

Upload processing_song2midi.py

Browse files
Files changed (1) hide show
  1. processing_song2midi.py +3 -0
processing_song2midi.py CHANGED
@@ -60,6 +60,9 @@ class Song2MIDIProcessor(ProcessorMixin):
60
  attribute = getattr(self, attribute_name, None)
61
  input_data, input_kwargs = attribute_to_kwargs[attribute_name]
62
  if input_data is not None and attribute is not None:
 
 
 
63
  attribute_output = attribute(input_data, **kwargs[input_kwargs])
64
  outputs[attribute_name] = attribute_output
65
 
 
60
  attribute = getattr(self, attribute_name, None)
61
  input_data, input_kwargs = attribute_to_kwargs[attribute_name]
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
+ input_data = input_data if input_data is not None else ""
66
  attribute_output = attribute(input_data, **kwargs[input_kwargs])
67
  outputs[attribute_name] = attribute_output
68