Skip to content

Commit

Permalink
chore: fix new api
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrery committed Jan 10, 2025
1 parent d2a401d commit 2891a9e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion use_case_examples/lora_finetuning/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,11 @@ def metric_fn(model, dataloader):
0, tokenizer.vocab_size, (PER_DEVICE_TRAIN_BATCH_SIZE, BLOCK_SIZE), dtype=torch.long
)
attention_mask = torch.ones((PER_DEVICE_TRAIN_BATCH_SIZE, BLOCK_SIZE), dtype=torch.long)
inputset = (input_tensor, label_tensor, attention_mask)
inputset = {
"input_ids": input_tensor,
"attention_mask": attention_mask,
"labels": label_tensor
}

# Prepare eval loader
eval_loader = DataLoader(test_dataset, batch_size=4, shuffle=False, collate_fn=data_collator)
Expand Down

0 comments on commit 2891a9e

Please sign in to comment.