diff --git a/opencompass/models/lmdeploy_pytorch.py b/opencompass/models/lmdeploy_pytorch.py index 814c3cc68..e75ac021a 100644 --- a/opencompass/models/lmdeploy_pytorch.py +++ b/opencompass/models/lmdeploy_pytorch.py @@ -145,9 +145,10 @@ def _generate(self, assert type( prompt) is str, 'We only support string for TurboMind Python API' input_ids = self.tokenizer.encode(prompt) - _, output_ids, _ = generator.infer(session_id, + outputs = generator.infer(session_id, input_ids, gen_config=gen_config) + output_ids = outputs.token_ids # stop engine if hasattr(generator, 'end'): generator.end(session_id) diff --git a/opencompass/models/turbomind.py b/opencompass/models/turbomind.py index 50c3e5ca6..899097a77 100644 --- a/opencompass/models/turbomind.py +++ b/opencompass/models/turbomind.py @@ -165,7 +165,7 @@ def _generate(self, sequence_end=True, step=0, stream_output=False): - _, output_ids, _ = outputs + output_ids = outputs.token_ids response = self.tokenizer.decode(output_ids) response = valid_str(response) # used to trim