Skip to content

Commit

Permalink
mini fix for stop sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
clefourrier committed Feb 8, 2024
1 parent e2b1516 commit 1b1aa8e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/lighteval/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1b1aa8e

Please sign in to comment.