Skip to content

Commit

Permalink
[fix] cannot import name 'Pop2PianoFeatureExtractor' from 'transforme…
Browse files Browse the repository at this point in the history
…rs' (#35604)

* update pop2piano __init__

* add lib check

* update fix

* revert
  • Loading branch information
faaany authored Jan 20, 2025
1 parent b80e334 commit 3998fa8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,3 +448,6 @@ def __call__(
)

return output


__all__ = ["Pop2PianoFeatureExtractor"]
3 changes: 3 additions & 0 deletions src/transformers/models/pop2piano/processing_pop2piano.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,6 @@ def save_pretrained(self, save_directory, **kwargs):
def from_pretrained(cls, pretrained_model_name_or_path, **kwargs):
args = cls._get_arguments_from_pretrained(pretrained_model_name_or_path, **kwargs)
return cls(*args)


__all__ = ["Pop2PianoProcessor"]
3 changes: 3 additions & 0 deletions src/transformers/models/pop2piano/tokenization_pop2piano.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,3 +714,6 @@ def batch_decode(
return BatchEncoding({"notes": notes_list, "pretty_midi_objects": pretty_midi_objects_list})

return BatchEncoding({"notes": notes_list})


__all__ = ["Pop2PianoTokenizer"]

0 comments on commit 3998fa8

Please sign in to comment.