Replies: 19 comments 3 replies
-
Hi there, I think this could be related to the NumPy 2.0 release yesterday night, which causes a lot of problems for lots of people everywhere since it makes breaking changes in various libraries. Until the NumPy team has a fix, could you try
to see if it fixes the problem? In addition, I will also look into making updates specifically NumPy 2.0 in the next few days. |
Beta Was this translation helpful? Give feedback.
-
Thankyou sir, I tried getting this output Requirement already satisfied: numpy<2.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (1.26.4) I think problem is something else ,, I tried Chatgpt , Claude ai , Gemini , still not working |
Beta Was this translation helpful? Give feedback.
-
Can you do a As an idea, you could try this code for the def assign(left, right):
if left.shape != right.shape:
raise ValueError(f"Shape mismatch. Left: {left.shape}, Right: {right.shape}")
return torch.nn.Parameter(torch.tensor(right).clone().detach()) |
Beta Was this translation helpful? Give feedback.
-
Thanks for reporting. And hm, that's odd, have you tried to run the chapter 5 notebook here exactly or did you make any modifications? I am asking because it working for me on both macOS and Linux. Could you run this notebook to make sure all packages are up to date: https://github.com/rasbt/LLMs-from-scratch/blob/main/setup/02_installing-python-libraries/python_environment_check.ipynb |
Beta Was this translation helpful? Give feedback.
-
If you could try changing def assign(left, right):
if left.shape != right.shape:
raise ValueError(f"Shape mismatch. Left: {left.shape}, Right: {right.shape}")
return torch.nn.Parameter(torch.tensor(right)) to def assign(left, right):
if left.shape != right.shape:
raise ValueError(f"Shape mismatch. Left: {left.shape}, Right: {right.shape}")
return torch.nn.Parameter(torch.tensor(right).clone().detach()) # Changed as suggested by @d-kleine above, let us know if it fixes it. If yes, I am happy to add this modification to the notebook and book. |
Beta Was this translation helpful? Give feedback.
-
The following packages need to be installed: and getting this error AttributeError Traceback (most recent call last) Cell In[176], line 11 File ~/anaconda3/lib/python3.11/site-packages/torch/nn/modules/module.py:1688, in Module.getattr(self, name) AttributeError: 'MultiHeadAttention' object has no attribute ‘W_query' |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Yes, I tried installing it again, but I am getting I tried to upload whole file to chatgpt and asked still getting error Ill download and try your code Thanks a lot |
Beta Was this translation helpful? Give feedback.
-
@rasbt I think it would be good to have issue templates, e.g. for bug reports, feature requests, etc. That would help to somewhat "standardize" issues by asking users questions like "what's your OS?", "which python are you using?", "have you checked that your packages version match with the ones provided in the requirements.txt in the root dir?", "how to reproduce the descriped bug?", "what you have you already tried to resolve the issue?", etc. |
Beta Was this translation helpful? Give feedback.
-
Yes, I agree. I added two templates. I don't want to overcomplicate it to keep it quick and easy to report an issue. |
Beta Was this translation helpful? Give feedback.
-
Looks good, thanks! 👍🏻
|
Beta Was this translation helpful? Give feedback.
-
Since some people had issues with Colab, yeah, that's a good idea. |
Beta Was this translation helpful? Give feedback.
-
Locally (on my computer) |
Beta Was this translation helpful? Give feedback.
-
Does the issue still persist when you ran the notebook from top to bottom? |
Beta Was this translation helpful? Give feedback.
-
https://github.com/athul-22/LLM-from-scratch/blob/MAIN/main.ipynb THIS IS MY WHOLE REPO,, EVERYTHING IS WORKING EXCEPT THE LAST CODE. PLS HELP I TRIED MULTIPLE WAYS AND I STUCKED HERE |
Beta Was this translation helpful? Give feedback.
-
Yes sir , Only that cell |
Beta Was this translation helpful? Give feedback.
-
Can't see code, please change the repo to be public (it seems like you have cloned the repo, it would have been better if you would have forked it in this case). And please pull the latest commits. |
Beta Was this translation helpful? Give feedback.
-
Sorry pls check now , Thanks ,, just that last part getting error , showing tensor size is not matching 256 and 1024 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
https://github.com/rasbt/LLMs-from-scratch/blob/main/ch05/01_main-chapter-code/ch05.ipynb
Beta Was this translation helpful? Give feedback.
All reactions