Merge branch 'main' into minicpmv

Former-commit-id: d8840ae416660e23f1d615ffd404f519360151d9
This commit is contained in:
Zhangchi Feng
2025-01-10 20:12:07 +08:00
committed by GitHub
41 changed files with 647 additions and 357 deletions

View File

@@ -75,10 +75,14 @@ class BasePlugin:
Validates if this model accepts the input modalities.
"""
if len(images) != 0 and self.image_token is None:
raise ValueError("This model does not support image input.")
raise ValueError(
"This model does not support image input. Please check whether the correct `template` is used."
)
if len(videos) != 0 and self.video_token is None:
raise ValueError("This model does not support video input.")
raise ValueError(
"This model does not support video input. Please check whether the correct `template` is used."
)
def _preprocess_image(self, image: "ImageObject", **kwargs) -> "ImageObject":
r"""