Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
clefourrier committed Jan 31, 2024
1 parent 17bdf23 commit 3c732d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lighteval/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

0 comments on commit 3c732d0

Please sign in to comment.