diff --git a/lagent/llms/base_llm.py b/lagent/llms/base_llm.py index a4ee9b95..b9687eae 100644 --- a/lagent/llms/base_llm.py +++ b/lagent/llms/base_llm.py @@ -183,12 +183,12 @@ def chat(self, inputs: Union[List[dict], List[List[dict]]], **gen_params): Returns: """ if isinstance(inputs[0], list): - inputs = list() + _inputs = list() for msg in inputs: - inputs.append(self.template_parser(msg)) + _inputs.append(self.template_parser(msg)) else: - inputs = self.template_parser(inputs) - return self.generate(inputs, **gen_params) + _inputs = self.template_parser(inputs) + return self.generate(_inputs, **gen_params) def generate_from_template(self, inputs: Union[List[dict], List[List[dict]]],