mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
parent
7c7fa36235
commit
3754dc1b67
@ -86,6 +86,8 @@ class LmdeployPytorchModel(BaseModel):
|
||||
for token_id in generation_config.eos_token_id:
|
||||
stop_words.append(token_id)
|
||||
gen_config.stop_words = stop_words
|
||||
if version_info >= (0, 6, 0):
|
||||
gen_config.stop_token_ids = stop_words
|
||||
self.gen_config = gen_config
|
||||
self.end_str = end_str
|
||||
self.major_version, self.minor_version = version_info[:2]
|
||||
|
@ -126,6 +126,7 @@ class TurboMindModelwithChatTemplate(BaseModel):
|
||||
'top_k': 1,
|
||||
'stop_words': encode_stop_words,
|
||||
}
|
||||
|
||||
gen_config = copy.deepcopy(DEFAULT_GEN_CONFIG)
|
||||
gen_config.update(self.gen_config)
|
||||
if do_sample:
|
||||
@ -134,6 +135,9 @@ class TurboMindModelwithChatTemplate(BaseModel):
|
||||
|
||||
from lmdeploy.messages import GenerationConfig
|
||||
gen_config = GenerationConfig(**gen_config)
|
||||
if self.version_info >= (0, 6, 0):
|
||||
gen_config.stop_words = stop_words
|
||||
gen_config.convert_stop_bad_words_to_ids(self.tokenizer)
|
||||
|
||||
results = []
|
||||
for batch_message in batch_messages:
|
||||
|
Loading…
Reference in New Issue
Block a user