From de4dd7e12fbb1546f65e1abb03811fbb483292af Mon Sep 17 00:00:00 2001 From: Nathan Habib Date: Wed, 7 Feb 2024 18:46:10 +0000 Subject: [PATCH 1/2] fix --- src/lighteval/main_nanotron.py | 1 - src/lighteval/models/nanotron_model.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lighteval/main_nanotron.py b/src/lighteval/main_nanotron.py index d8d87b86..523e73ce 100644 --- a/src/lighteval/main_nanotron.py +++ b/src/lighteval/main_nanotron.py @@ -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, diff --git a/src/lighteval/models/nanotron_model.py b/src/lighteval/models/nanotron_model.py index 38b1bd2a..3c74fb27 100644 --- a/src/lighteval/models/nanotron_model.py +++ b/src/lighteval/models/nanotron_model.py @@ -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 = request.stop_sequence + [self.tokenizer.eos_token] request.tokenized_context = self.tok_encode(request.context) dataset = GenerativeTaskDatasetNanotron(requests=requests, dataset_splits=dataset_splits) From 98f767f19fe7b9a3e798c460045803d85dc795af Mon Sep 17 00:00:00 2001 From: Nathan Habib <30601243+NathanHB@users.noreply.github.com> Date: Wed, 7 Feb 2024 20:14:17 +0100 Subject: [PATCH 2/2] Update src/lighteval/models/nanotron_model.py Co-authored-by: Thomas Wolf --- src/lighteval/models/nanotron_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lighteval/models/nanotron_model.py b/src/lighteval/models/nanotron_model.py index 3c74fb27..4d349bfb 100644 --- a/src/lighteval/models/nanotron_model.py +++ b/src/lighteval/models/nanotron_model.py @@ -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)