MCPcopy Create free account
hub / github.com/aiming-lab/MDocAgent / process_message

Method process_message

models/base_model.py:16–31  ·  view source on GitHub ↗
(self, question, texts, images, history)

Source from the content-addressed store, hash-verified

14 torch.cuda.empty_cache()
15
16 def process_message(self, question, texts, images, history):
17 if history is not None:
18 assert(self.is_valid_history(history))
19 messages = history
20 else:
21 messages = []
22
23 if texts is not None:
24 messages.append(self.create_text_message(texts, question))
25 if images is not None:
26 messages.append(self.create_image_message(images, question))
27
28 if (texts is None or len(texts) == 0) and (images is None or len(images) == 0):
29 messages.append(self.create_ask_message(question))
30
31 return messages
32
33 def is_valid_history(self, history):
34 return True

Callers 3

predictMethod · 0.80
predictMethod · 0.80
predictMethod · 0.80

Calls 3

is_valid_historyMethod · 0.95
create_text_messageMethod · 0.45
create_image_messageMethod · 0.45

Tested by

no test coverage detected