def batch_forward()

in src/models/struxgpt_v1.py [0:0]


    def batch_forward(self, text_list: List[str], return_json=True, **kwargs):
        prompt_list = [self.prepare_prompt(text) for text in text_list]

        maxOutputLength = kwargs.pop('maxOutputLength', self.max_output_length)
        response_list = self.call_model(prompt_list, batched=True, maxOutputLength=maxOutputLength,
                                        **kwargs)

        struct_res_list = [StructItem(self.scfg, text, response) \
                                for text, response in zip(text_list, response_list)]
        
        if return_json:
            return zip(*[[struct_res.valid, struct_res.dict] for struct_res in struct_res_list])
        else:
            return struct_res_list