-
Notifications
You must be signed in to change notification settings - Fork 238
自定义多模态Document报错 #1015
Copy link
Copy link
Closed
Description
Describe the bug
我根据文档用dataclass装饰器自定义多模态Document,此时,如果定义的多模态模型图片为List[Image],但当我传入的图片只有一张时,则通过属性获取该数据时,获取到的并非为一个列表,而是一个Document。
To Reproduce
from docarray import Document, dataclass
from docarray.typing import Text, Image
from typing import List
@dataclass
class MyDoc:
title: Text
images: List[Image]
my = MyDoc(title='黎明', images=['https://bkimg.cdn.bcebos.com/pic/359b033b5bb5c9ea15ce3757e86fa1003af33a871573?x-bce-process=image/watermark,image_d2F0ZXIvYmFpa2UxNTA=,g_7,xp_5,yp_5'])
doc = Document(my)
img = doc.images[0]Expected behavior
此时应该返回一个列表
Desktop (please complete the following information):
- Version [0.20.1]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
