MCPcopy Create free account
hub / github.com/EmbodiedGPT/EmbodiedGPT_Pytorch / ask

Method ask

demo/test.py:287–300  ·  view source on GitHub ↗
(self, text, conv, modal_type="image")

Source from the content-addressed store, hash-verified

285 )
286
287 def ask(self, text, conv, modal_type="image"):
288 assert modal_type in ["text", "image", "video"]
289 conversations = []
290
291 if len(conv.messages) > 0 or modal_type == "text":
292 conv.append_message(conv.roles[0], text)
293 elif modal_type == "image":
294 conv.append_message(conv.roles[0], self.image_query + "\n" + text)
295 else:
296 conv.append_message(conv.roles[0], self.video_query + "\n" + text)
297
298 conv.append_message(conv.roles[1], None)
299 conversations.append(conv.get_prompt())
300 return conversations
301
302 @torch.no_grad()
303 def get_image_embedding(self, image_file):

Callers 1

test.pyFile · 0.45

Calls 2

append_messageMethod · 0.80
get_promptMethod · 0.80

Tested by

no test coverage detected