Skip to content

Commit

Permalink
fixing nanotron (#21)
Browse files Browse the repository at this point in the history
* fix

* Update src/lighteval/models/nanotron_model.py

Co-authored-by: Thomas Wolf <thomwolf@users.noreply.github.com>

---------

Co-authored-by: Thomas Wolf <thomwolf@users.noreply.github.com>
  • Loading branch information
NathanHB and thomwolf authored Feb 7, 2024
1 parent b409d95 commit 59891e0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/lighteval/main_nanotron.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ def main(
parallel_config=lighteval_config.parallelism,
lighteval_config=lighteval_config,
batch_size=lighteval_config.batch_size,
cache_dir=os.environ.get("HF_HOME", "/scratch"),
debug_one_layer_model=False,
model_class=model_cls,
env_config=env_config,
Expand Down
2 changes: 1 addition & 1 deletion src/lighteval/models/nanotron_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ def greedy_until(
# automatic (variable) batch size detection for vectorization
# pull longest context sample from request
for request in requests:
request.stop_sequence = request.stop_sequence + (self.tokenizer.eos_token,)
request.stop_sequence = list(request.stop_sequence) + [self.tokenizer.eos_token]
request.tokenized_context = self.tok_encode(request.context)

dataset = GenerativeTaskDatasetNanotron(requests=requests, dataset_splits=dataset_splits)
Expand Down

0 comments on commit 59891e0

Please sign in to comment.