[Assignment 4 Wiki] Incorrect tokenizer output keyword
Closed this issue · 1 comments
vietanh125 commented
In the training loop code snippet,
loss_function = <create your loss function>
optimizer = <create your optimizer>
for epoch in range(NUM_EPOCHS):
for batch in dataloader:
inputs = batch["inputs"]
gold_outputs = batch["labels"]
predicted_logits = model(inputs)
batch_loss = loss_function(predicted_logits, gold_outputs)
optimizer.zero_grad()
batch_loss.backward()
optimizer.step()
I suppose the keyword for taking inputs from the batch should be input_ids
instead of inputs
.
alexanderkoller commented
Thank you, I fixed it.