You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Might the code below will give you some ideas about how to construct conversations about pure text, single image, multiple images
defparse_input(self, query=None, imgs=None):
""" Parses the input query and images into the expected format. Parameters ---------- query : str, optional The query from the user. imgs : list or str, optional A list of images or a single image path. Returns ------- list of dict A list containing the messages formatted for the model. """ifimgsisNone:
messages= [
{"role": "user", "content": query},
]
returnmessagesifisinstance(imgs, str):
imgs= [imgs]
content= []
forimginimgs:
content.append({
"type": "image",
"image": img
})
content.append({
"type": "text",
"text": query
})
messages= [
{"role": "user", "content": content},
]
returnmessages
The model seems to need to transmit as many images as there are questions.
Otherwise, you just keep repeating your previous answer.
I would like to have a conversation without images, but upload images only when necessary. Is this impossible?
The text was updated successfully, but these errors were encountered: