Skip to content

Commit

Permalink
fix batch generate (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
Harold-lkk authored Feb 20, 2024
1 parent 6620117 commit a64aa59
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lagent/llms/base_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]],
Expand Down

0 comments on commit a64aa59

Please sign in to comment.