mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2025-07-28 03:14:00 +00:00
Merge pull request #157 from DrCesar/main
fix move model to device before calculating loss
This commit is contained in:
commit
738ec44bf9
@ -425,6 +425,7 @@
|
||||
"\n",
|
||||
"torch.manual_seed(123)\n",
|
||||
"model = GPTModel(GPT_CONFIG_124M)\n",
|
||||
"model.to(device)\n",
|
||||
"\n",
|
||||
"loss = calc_loss_batch(input_batch, target_batch, model, device)\n",
|
||||
"loss.backward()"
|
||||
|
Loading…
x
Reference in New Issue
Block a user