[Model] Multi-input support for LLaVA (#8238)

This commit is contained in:
Cyrus Leung
2024-09-07 10:57:24 +08:00
committed by GitHub
parent 41e95c5247
commit 2f707fcb35
10 changed files with 176 additions and 45 deletions

View File

@@ -110,7 +110,7 @@ def input_processor_for_siglip(
if isinstance(image_data, Image.Image):
image_feature_size = get_siglip_image_feature_size(hf_config)
elif isinstance(image_data, torch.Tensor):
image_feature_size = image_data.shape[0]
num_images, image_feature_size, hidden_size = image_data.shape
else:
raise TypeError(f"Invalid image type: {type(image_data)}")
else: