Browse Source

[to #42322933][bug fix] convert gemm output torch tensor to numpy array for demo support

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/10342977
master
lingchen.zlm yingda.chen 3 years ago
parent
commit
b151056b4e
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      modelscope/models/multi_modal/gemm/gemm_base.py

+ 1
- 0
modelscope/models/multi_modal/gemm/gemm_base.py View File

@@ -543,6 +543,7 @@ class GEMMModel(nn.Module):
img_feature, text_feature, caption = None, None, None img_feature, text_feature, caption = None, None, None
if captioning and image is not None: if captioning and image is not None:
img_feature, caption = self.model.image_to_text(image) img_feature, caption = self.model.image_to_text(image)
img_feature = self.parse_feat(img_feature)
elif image is not None: elif image is not None:
img_feature = self.parse_feat(self.model.encode_image(image)) img_feature = self.parse_feat(self.model.encode_image(image))
if text is not None: if text is not None:


Loading…
Cancel
Save