Skip to main content

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

TinyShakespeareLoader-1.0.7.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

TinyShakespeareLoader-1.0.7-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file TinyShakespeareLoader-1.0.7.tar.gz.

File metadata

  • Download URL: TinyShakespeareLoader-1.0.7.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for TinyShakespeareLoader-1.0.7.tar.gz
Algorithm Hash digest
SHA256 c693aa2cd970daa5b380bbe061b813f62ca2e995f015c08c946f4c8b320a4c0b
MD5 c4fa097d912565cfca901c639fb70a32
BLAKE2b-256 8af71021845438d5ab70cb99b898dd3f3f88d2cf3d9a9dc8e81fdd8f37743b12

See more details on using hashes here.

File details

Details for the file TinyShakespeareLoader-1.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for TinyShakespeareLoader-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3f344ce7b6ea6904bbd5444b8b397d848e5ccef9b36493ddd815ef61b564ba47
MD5 f04dfc6558d8bbb1c3f032ec89ecf0d8
BLAKE2b-256 e91ff55bb73a86a5e12ce8eb0c2f58da52f361b36fa732ca793e254b5ca79802

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page