To be overriden by the descendant class
(self, input:Dict[str,str], spatial_info:Dict[str,Any], temporal_info:Dict[str,Any], mode: str = "default", **kwargs)
| 674 | return max_output |
| 675 | |
| 676 | async def _async_execute(self, input:Dict[str,str], spatial_info:Dict[str,Any], temporal_info:Dict[str,Any], mode: str = "default", **kwargs): |
| 677 | """ To be overriden by the descendant class """ |
| 678 | """ Use the processed input to get the result """ |
| 679 | output_num = {} |
| 680 | max_output = "" |
| 681 | max_output_num = 0 |
| 682 | for info in spatial_info.values(): |
| 683 | processed_output = await self.prompt_set.postprocess_answer(info['output']) |
| 684 | logger.debug("Processed output: {}", processed_output) |
| 685 | if processed_output in output_num: |
| 686 | output_num[processed_output] += 1 |
| 687 | else: |
| 688 | output_num[processed_output] = 1 |
| 689 | if output_num[processed_output] > max_output_num: |
| 690 | max_output = processed_output |
| 691 | max_output_num = output_num[processed_output] |
| 692 | if mode == "allow_kv_reuse": |
| 693 | return input.get("task"), max_output |
| 694 | return max_output |
nothing calls this directly
no test coverage detected