This is a PyTorch DataLoader for the TinyShakespeare dataset.
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
data = get_data()
train_dataloader, test_dataloader = data["train_dataloader"], data["test_dataloader"]
for batch in train_dataloader:
print(batch)
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-1.0.5.tar.gz
.
File metadata
- Download URL: TinyShakespeareLoader-1.0.5.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbbc311329db7910856c2cde060724c88a0e0633fa47e142e12c901d4c47a020 |
|
MD5 | 7881ca2a075256db43c28cf26e5cd457 |
|
BLAKE2b-256 | 8887d7603fe2d6812b8f22db1c0e93aa92bb242467395f9717aa25a9bacddbf9 |
File details
Details for the file TinyShakespeareLoader-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: TinyShakespeareLoader-1.0.5-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8012029ab2256cf49b2079074b84a7003e6eb8628fb0b7dbe13669d4d9591cd |
|
MD5 | cebf4b8d8077e6ad2b0a948f3493e66c |
|
BLAKE2b-256 | d1cf76cf1caf7ed0f8229497ed02e9b0e05b34a94e413f7f44f5bd380c2b3ec6 |