Comments (2)
Hi there,
thanks for your interest in my book!
as some of the tools used do not mention which versions you used.
I just double-checked the chapter text and code notebook, and it's tiktoken 0.5.1.
Regarding PyTorch, I used 2.0.1
![Screenshot 2023-12-25 at 8 06 25 AM](https://private-user-images.githubusercontent.com/5618407/292724605-ae463fc1-4c17-4d0a-9e92-ce4cb5cb3e19.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTQ5MjM2MTksIm5iZiI6MTcxNDkyMzMxOSwicGF0aCI6Ii81NjE4NDA3LzI5MjcyNDYwNS1hZTQ2M2ZjMS00YzE3LTRkMGEtOWU5Mi1jZTRjYjVjYjNlMTkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDUwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA1MDVUMTUzNTE5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2E3NGQ1YjI3ZTMwNjk2ZjgwMGNiNjE1MjBhNjcyZTU0NmY2YTQ3MmVjM2RkZDBiMjAwMGE4YzA3M2RkNTJjOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.1ghPa_80FQDw2QEWAh0ZSdso7bKdRaGAXSZ_lr4wZJY)
but newer versions also work.
Please let me know if the version for any external package is missing, and I'd be happy to add it.
Python 3.9 and 3.10. and both successfully install tiktoken, but fail to import it in the jupyter notebook.
From my teaching experience, this is usually very rare, but it can unfortunately be a frustrating experience sometimes when it happens. This is usually not a Python or package version issue but related to the operating system and computer and how Python and Jupyter were installed. What can happen is that on some computers the pip
version installs it in an environment that is different from that of the notebook.
Sometimes, the easy fix is to restart Jupyter notebook after pip-installing the package.
Alternatively, I uploaded the code notebook here to Google Colab: https://colab.research.google.com/drive/1tnfoUBz9MraKco-UdDiqr97J418xFTDi?usp=sharing
Please let me know if you have any follow-up questions, I'm happy to help.
from llms-from-scratch.
I do think you are correct about the Python & Jupyter installation being the issue. I haven't isolated the actual issue yet, but for now installing the package directly on the jupyter notebook (or colab) seems to work.
Thanks Rasbt
from llms-from-scratch.
Related Issues (20)
- In 3.3.1, there seems to be a missing image between "The attention weights and context vector calculation are summarized in the figure below:" and "The code below walks through the figure above step by step." HOT 1
- RuntimeError: size mismatch - ch05/03_bonus_pretraining_on_gutenberg HOT 2
- book feedback HOT 1
- The definition of stride is confusing in 2.6 HOT 3
- Difference btwn book and repo HOT 1
- class MHAPyTorchScaledDotProduct HOT 2
- Incorrect description of function torch.arange() (2.8 Encoding word positions) HOT 1
- Inconsistencies in output for dropout section (3.5.2 Masking additional attention weights with dropout) HOT 1
- Probably a typo in multi-head attention description (3.6.1 Stacking multiple single-head attention layers) HOT 1
- Solution for Exercise 3.2 is included in the notebook with main code (3.6.1 Stacking multiple single-head attention layers) HOT 1
- Question about implementation of CausalAttention class (3.5.3 Implementing a compact causal self-attention class) HOT 6
- Inconsistencies in unsqueeze operation description in the book and in notebook and its necessity (3.6.2 Implementing multi-head attention with weight splits) HOT 4
- Solution for Exercise 3.3 is included in the notebook with main code (3.6.2 Implementing multi-head attention with weight splits) HOT 1
- Inconsistencies in MHA Wrapper Implementation Between Chapter 3 Main Content and Bonus Material HOT 1
- Offering Chinese Translation for 'Build a Large Language Model From Scratch HOT 3
- Chapter 5 - Context Size and the DataLoaders HOT 2
- Feedback: Stripe output from notebook HOT 2
- About endoftext in ch05/03_bonus_pretraining_on_gutenberg/pretraining_simple.py HOT 14
- Contributions for Chinese simplified version HOT 4
- {Q} : Replacing the LlamaDecoderLayer Class hugging Face With New LongNet
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llms-from-scratch.