Create a random batch of input_ids and labels.
(args)
| 65 | |
| 66 | |
| 67 | def make_batch(args): |
| 68 | """Create a random batch of input_ids and labels.""" |
| 69 | input_ids = torch.randint(0, args.vocab_size, (args.batch_size, args.seq_len), device=args.device) |
| 70 | labels = input_ids.clone() |
| 71 | return input_ids, labels |
| 72 | |
| 73 | |
| 74 | def cleanup(device_type): |