Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transformer Example Update - AutoModelforSequenceClassification #2190

Merged
merged 8 commits into from
Sep 17, 2021
Merged
Prev Previous commit
Next Next commit
minor fix
  • Loading branch information
Ishan-Kumar2 committed Sep 12, 2021
commit d5fdba1b7bbdc16460b3a96e9c9f7494be7095a9
2 changes: 1 addition & 1 deletion examples/contrib/transformers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def train_step(engine, batch):
labels = batch[1].view(-1, 1)

if labels.device != device:
input_batch = {k: v.to(device, non_blocking=True, dtype=torch.long) for k, v in batch.items()}
input_batch = {k: v.to(device, non_blocking=True, dtype=torch.long) for k, v in batch[0].items()}
labels = labels.to(device, non_blocking=True, dtype=torch.float)

model.train()
Expand Down