(self, question, texts, images, history)
| 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 |
no test coverage detected