Skip to content

Commit

Permalink
fix error when appending eot_token_id for generate_until tasks (Eleut…
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiopperez authored Apr 18, 2024
1 parent 8b326be commit dc5eba8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lm_eval/models/nemo_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,8 @@ def generate_until(self, requests):
def get_until(req_args):
until = req_args.get("until", [])
until = deepcopy(until) # prevent from modifying req_args for cache_key
if self.eot_token_id not in until:
until.append(self.eot_token_id)
if self.tokenizer.ids_to_tokens([self.eot_token_id])[0] not in until:
until.append(self.tokenizer.ids_to_tokens([self.eot_token_id])[0])
return until

def _collate(x):
Expand Down

0 comments on commit dc5eba8

Please sign in to comment.