Merge pull request #4662 from oobabooga/dev

Merge dev branch
This commit is contained in:
oobabooga 2023-11-19 14:23:19 -03:00 committed by GitHub
commit 22e7a22d1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,10 @@ def get_next_logits(prompt, state, use_samplers, previous, return_dict=False):
if is_non_hf_exllamav1 or is_non_hf_llamacpp: if is_non_hf_exllamav1 or is_non_hf_llamacpp:
topk_indices = [i.expand((1, 1)) for i in topk_indices] topk_indices = [i.expand((1, 1)) for i in topk_indices]
tokens = [shared.tokenizer.decode(i) for i in topk_indices] if hasattr(shared.tokenizer, 'convert_ids_to_tokens'):
tokens = [shared.tokenizer.convert_ids_to_tokens(int(i)) for i in topk_indices]
else:
tokens = [shared.tokenizer.decode(i) for i in topk_indices]
if return_dict: if return_dict:
output = {} output = {}