From 3998fa8aab73e78de9dd9717407c4108728e8f5b Mon Sep 17 00:00:00 2001 From: Fanli Lin Date: Mon, 20 Jan 2025 22:21:45 +0800 Subject: [PATCH] [fix] cannot import name 'Pop2PianoFeatureExtractor' from 'transformers' (#35604) * update pop2piano __init__ * add lib check * update fix * revert --- .../models/pop2piano/feature_extraction_pop2piano.py | 3 +++ src/transformers/models/pop2piano/processing_pop2piano.py | 3 +++ src/transformers/models/pop2piano/tokenization_pop2piano.py | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/transformers/models/pop2piano/feature_extraction_pop2piano.py b/src/transformers/models/pop2piano/feature_extraction_pop2piano.py index 738b932355d..89fb04907d6 100644 --- a/src/transformers/models/pop2piano/feature_extraction_pop2piano.py +++ b/src/transformers/models/pop2piano/feature_extraction_pop2piano.py @@ -448,3 +448,6 @@ class Pop2PianoFeatureExtractor(SequenceFeatureExtractor): ) return output + + +__all__ = ["Pop2PianoFeatureExtractor"] diff --git a/src/transformers/models/pop2piano/processing_pop2piano.py b/src/transformers/models/pop2piano/processing_pop2piano.py index 280e5dc7960..11afcab3176 100644 --- a/src/transformers/models/pop2piano/processing_pop2piano.py +++ b/src/transformers/models/pop2piano/processing_pop2piano.py @@ -137,3 +137,6 @@ class Pop2PianoProcessor(ProcessorMixin): 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"] diff --git a/src/transformers/models/pop2piano/tokenization_pop2piano.py b/src/transformers/models/pop2piano/tokenization_pop2piano.py index 5ad0996c15a..18adb2e9621 100644 --- a/src/transformers/models/pop2piano/tokenization_pop2piano.py +++ b/src/transformers/models/pop2piano/tokenization_pop2piano.py @@ -714,3 +714,6 @@ class Pop2PianoTokenizer(PreTrainedTokenizer): return BatchEncoding({"notes": notes_list, "pretty_midi_objects": pretty_midi_objects_list}) return BatchEncoding({"notes": notes_list}) + + +__all__ = ["Pop2PianoTokenizer"]