Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract dataset functionality for easy extensibility #360

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

alxkolm
Copy link

@alxkolm alxkolm commented Aug 26, 2023

Extract dataset functionality for easy extensibility

Summary of changes:

  1. Added dataset.py with Dataset base class. It encapsulates downloading and iterating over examples in files. There are 3 methods download(), list_files(), examples_of() in the class
  2. Download functionality moved from tinystories.py to Dataset
  3. These functions now receive Dataset as argument: train_vocab(), pretokenize(), process_shard()
  4. Pre-tokenized files now write to tokenized_{vocab_size} directories. Files tokenized by Llama2 tokenizer write to tokenized_llama2 directory.
  5. Wrapped Tinystories dataset to TinyStories class in dataset.py
  6. Added new SQLCreateContext from sql-create-context as example of extensibility.

To hold git diff as simple as possible, I have not renamed the main entry point file tinystories.py. But in future, it should be renamed to something like prepare.py.

train.py is not affected by this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant