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

Method ask

demo/script.py:334–347  ·  view source on GitHub ↗
(self, text, conv, modal_type="image")

Source from the content-addressed store, hash-verified

332
333
334 def ask(self, text, conv, modal_type="image"):
335 assert modal_type in ["text", "image", "video"]
336 conversations = []
337
338 if len(conv.messages) > 0 or modal_type == "text":
339 conv.append_message(conv.roles[0], text)
340 elif modal_type == "image":
341 conv.append_message(conv.roles[0], self.image_query + "\n" + text)
342 else:
343 conv.append_message(conv.roles[0], self.video_query + "\n" + text)
344
345 conv.append_message(conv.roles[1], None)
346 conversations.append(conv.get_prompt())
347 return conversations
348
349 @torch.no_grad()
350 def get_image_embedding(self, image_file):

Callers 2

ask_questionMethod · 0.95
post_questionMethod · 0.95

Calls 2

append_messageMethod · 0.80
get_promptMethod · 0.80

Tested by

no test coverage detected