From 3c732d007b1a6aeac6b282b7735fd18a152274d8 Mon Sep 17 00:00:00 2001 From: "clementine@huggingface.co" Date: Wed, 31 Jan 2024 14:19:05 +0000 Subject: [PATCH] style --- src/lighteval/models/base_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lighteval/models/base_model.py b/src/lighteval/models/base_model.py index 2b309daa..7bf6ca76 100644 --- a/src/lighteval/models/base_model.py +++ b/src/lighteval/models/base_model.py @@ -4,8 +4,8 @@ import torch import torch.nn.functional as F import transformers -from torch.utils.data import DataLoader from torch.nn.utils.rnn import pad_sequence +from torch.utils.data import DataLoader from tqdm import tqdm from transformers import AutoTokenizer, BatchEncoding @@ -846,7 +846,7 @@ def _loglikelihood_single_token( # Sync all ## Need reshape before gather batched_inputs, len_inputs = self.pad_and_gather(prepared_batch.input_ids) - # We sometimes have different tasks with a different number of choices. + # We sometimes have different tasks with a different number of choices. # Padding to -10000 makes sure that we won't reach index problems later as all log probs will be smaller than that batch_probs = pad_sequence(batch_probs, batch_first=True, padding_value=-10000000) batch_probs, len_probs = self.pad_and_gather(batch_probs)