Fix/minicpmv46 missing version (#44980)
Signed-off-by: wjinxu <1299461899@qq.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -64,7 +64,12 @@ class MiniCPMOProcessor(ProcessorMixin):
|
||||
pool_step=2,
|
||||
):
|
||||
super().__init__(image_processor, feature_extractor, tokenizer)
|
||||
self.version = image_processor.version
|
||||
# Mirror the MiniCPMVProcessor guard: newer (transformers v5.7+)
|
||||
# MiniCPM image processors may drop the legacy `version` attribute,
|
||||
# so fall back to None instead of hard-crashing. `version` only
|
||||
# special-cases the 2.5 tokenization path; other values take the
|
||||
# default branch.
|
||||
self.version = getattr(image_processor, "version", None)
|
||||
self.pool_step = pool_step
|
||||
|
||||
def _safe_get_token_id(self, attr_name, default_token_str):
|
||||
|
||||
Reference in New Issue
Block a user