LLMs-from-scratch icon indicating copy to clipboard operation
LLMs-from-scratch copied to clipboard

Update ch04.ipynb

Open rayed-therap opened this issue 1 year ago • 3 comments

Add missing import.

rayed-therap avatar Feb 27 '24 15:02 rayed-therap

Thanks for the PR, I appreciate it! However, I think in this notebook importing torch is not necessary as we are working with import torch.nn as nn. Did you bump into any import issues?

rasbt avatar Feb 27 '24 15:02 rasbt

torch.arange is used in calculating position embeddings.

rayed-therap avatar Feb 27 '24 16:02 rayed-therap

Ah yes good call. I see that I imported it here: Screenshot 2024-02-27 at 11 21 11 AM

rasbt avatar Feb 27 '24 17:02 rasbt

Thanks again for moving the import torch line up. I just removed the 2nd import to reduce redundancy.

rasbt avatar Mar 01 '24 02:03 rasbt