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

Method ask

demo/inference.py:286–299  ·  view source on GitHub ↗
(self, text, conv, modal_type="image")

Source from the content-addressed store, hash-verified

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

Callers 1

inference.pyFile · 0.45

Calls 2

append_messageMethod · 0.80
get_promptMethod · 0.80

Tested by

no test coverage detected