llama.cpp: fix ban_eos_token (#3987)

This commit is contained in:
Cebtenzzre 2023-09-18 11:15:02 -04:00 committed by GitHub
parent 0ede2965d5
commit 8466cf229a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,7 +120,7 @@ class LlamaCppModel:
logit_processors = LogitsProcessorList() logit_processors = LogitsProcessorList()
if state['ban_eos_token']: if state['ban_eos_token']:
logit_processors.append(partial(ban_eos_logits_processor, self.model.tokenizer.eos_token_id)) logit_processors.append(partial(ban_eos_logits_processor, self.model.token_eos()))
if state['custom_token_bans']: if state['custom_token_bans']:
to_ban = [int(x) for x in state['custom_token_bans'].split(',')] to_ban = [int(x) for x in state['custom_token_bans'].split(',')]