From 1b1aa8e7e617addb939c8e93a8e903b0ce2d445c Mon Sep 17 00:00:00 2001 From: "clementine@huggingface.co" Date: Thu, 8 Feb 2024 08:54:29 +0000 Subject: [PATCH] mini fix for stop sequence --- src/lighteval/models/base_model.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lighteval/models/base_model.py b/src/lighteval/models/base_model.py index 0f753a49..8ebe90de 100644 --- a/src/lighteval/models/base_model.py +++ b/src/lighteval/models/base_model.py @@ -22,9 +22,7 @@ LoglikelihoodSingleTokenRequest, Request, ) -from lighteval.utils import ( - is_accelerate_available, -) +from lighteval.utils import as_list, is_accelerate_available from lighteval.utils_parallelism import find_executable_batch_size @@ -342,7 +340,7 @@ def greedy_until( list[GenerateReturn]: list of generated responses. """ for request in requests: - request.stop_sequence = request.stop_sequence + [self.tokenizer.eos_token] + request.stop_sequence = as_list(request.stop_sequence) + [self.tokenizer.eos_token] request.tokenized_context = self.tok_encode(request.context) dataset = GenerativeTaskDataset(requests=requests, dataset_splits=self.DATASET_SPLITS)