Skip to content

Commit 8496ec7

Browse files
authored
[DataProcessor] Move image_processor to unified directory and add MultiModalProcessor (#7109)
* first commit * step 9~10 * update multimodal * update multimodal * fix load tokenizer * add unit test * fix unit test & AdaptiveImageProcessor * Delete unused code
1 parent d693d4b commit 8496ec7

File tree

15 files changed

+3039
-1403
lines changed

15 files changed

+3039
-1403
lines changed

fastdeploy/input/ernie4_5_vl_processor/image_preprocessor/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@
1414
# limitations under the License.
1515
"""
1616

17-
from .get_image_preprocessor import get_image_preprocessor
18-
from .image_preprocessor_adaptive import AdaptiveImageProcessor
17+
# Backward compatibility: this module has been migrated to
18+
# fastdeploy.input.image_processors.adaptive_processor
19+
# This file will be removed in a future version.
20+
21+
from fastdeploy.input.image_processors.adaptive_processor import ( # noqa: F401
22+
AdaptiveImageProcessor,
23+
get_image_preprocessor,
24+
)
1925

2026
__all__ = ["get_image_preprocessor", "AdaptiveImageProcessor"]

fastdeploy/input/ernie4_5_vl_processor/image_preprocessor/get_image_preprocessor.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,10 @@
1414
# limitations under the License.
1515
"""
1616

17-
"""get image preprocessor"""
17+
# Backward compatibility: this module has been migrated to
18+
# fastdeploy.input.image_processors.adaptive_processor
19+
# This file will be removed in a future version.
1820

19-
from fastdeploy.utils import data_processor_logger
20-
21-
from .image_preprocessor_adaptive import AdaptiveImageProcessor
22-
23-
24-
def get_image_preprocessor(args):
25-
"""
26-
get_image_preprocessor from args
27-
"""
28-
29-
if args.vision_model_name_or_path is None:
30-
return None
31-
32-
data_processor_logger.info("use AdaptiveImageProcessor")
33-
image_preprocess = AdaptiveImageProcessor.from_pretrained(args.vision_model_name_or_path)
34-
return image_preprocess
21+
from fastdeploy.input.image_processors.adaptive_processor import ( # noqa: F401
22+
get_image_preprocessor,
23+
)

0 commit comments

Comments
 (0)