[Refactor] Move MM data parsing outside processor (#33408)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
@@ -262,9 +262,8 @@ class Cohere2VisionMultiModalProcessor(
|
||||
hf_processor = self.info.get_hf_processor(**mm_kwargs)
|
||||
|
||||
# Fallback calculation if HF processor didn't provide num_patches
|
||||
parsed_images = self.data_parser.parse_mm_data({"image": images}).get_items(
|
||||
"image", ImageProcessorItems
|
||||
)
|
||||
mm_items = self.info.parse_mm_data({"image": images}, validate=False)
|
||||
parsed_images = mm_items.get_items("image", ImageProcessorItems)
|
||||
|
||||
num_patches = [
|
||||
self.info.get_num_patches(
|
||||
|
||||
Reference in New Issue
Block a user