No project description provided
Project description
TinyShakespeareLoader
A PyTorch DataLoader for the TinyShakespeare Dataset
If you followed Andrej Karparthy's tutorial on GPT, you will notice he used the TinyShakespeare dataset, but not with the PyTorch DataLoader. This repository fills that gap.
The TinyShakespeare dataset is a small dataset of Shakespeare's plays, with each line as a separate sample. To install this package, simply run:
pip install TinyShakespeareLoader
Then, to use it, simply import it and use it as a PyTorch DataLoader:
from TinyShakespeareLoader.hamlet import get_data
tinyshakespeare = get_data()
train_dataloader, test_dataloader = tinyshakespeare.train_dataloader, tinyshakespeare.test_dataloader
for batch in train_dataloader:
print(batch)
You can provide your own encoder function if you want - but it's not required! If you don't, it will just simply use the character level encoding, that Andrej also used in his tutorial.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tinyshakespeareloader-0.8.0.tar.gz
.
File metadata
- Download URL: tinyshakespeareloader-0.8.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.12 Darwin/23.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8bf5832c262295f722479ad859c222d03b29ddbc22f08243029d2b3b01dcd89 |
|
MD5 | f1ee6a24f41760cee8a94766c19da1b5 |
|
BLAKE2b-256 | ff37992acf4e5c3770a509cf775a81204931bc4c6dddfb813d65f43c54441a2e |
File details
Details for the file tinyshakespeareloader-0.8.0-py3-none-any.whl
.
File metadata
- Download URL: tinyshakespeareloader-0.8.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.12 Darwin/23.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24dc2a0ac8fdc9adc780f08c5f6a4cc20447fb5f063fb1d48698e77fbdcc752f |
|
MD5 | 14afcdba0a2af799d5c5b93af90e211c |
|
BLAKE2b-256 | 088c3e955cd9f5e7c7c85546d701227e542325f504d5779b3dd1e6b7550b19e3 |