Dataset Preview
Go to dataset viewer
The dataset preview is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    NotImplementedError
Message:      os.path.isdir is not extended to support URLs in streaming mode
Traceback:    Traceback (most recent call last):
                File "/src/workers/datasets_based/src/datasets_based/workers/", line 485, in compute_first_rows_response
                  rows = get_rows(
                File "/src/workers/datasets_based/src/datasets_based/workers/", line 120, in decorator
                  return func(*args, **kwargs)
                File "/src/workers/datasets_based/src/datasets_based/workers/", line 164, in get_rows
                  ds = load_dataset(
                File "/src/workers/datasets_based/.venv/lib/python3.9/site-packages/datasets/", line 1751, in load_dataset
                  return builder_instance.as_streaming_dataset(split=split)
                File "/src/workers/datasets_based/.venv/lib/python3.9/site-packages/datasets/", line 1206, in as_streaming_dataset
                  splits_generators = { sg for sg in self._split_generators(dl_manager)}
                File "/tmp/modules-cache/datasets_modules/datasets/tiny_shakespeare/b5b13969f09fe8707337f6cb296314fbe06960bd9a868dca39e713e163d27b5e/", line 75, in _split_generators
                  if os.path.isdir(download_path):
                File "/src/workers/datasets_based/.venv/lib/python3.9/site-packages/datasets/", line 70, in wrapper
                  return function(*args, use_auth_token=use_auth_token, **kwargs)
                File "/src/workers/datasets_based/.venv/lib/python3.9/site-packages/datasets/download/", line 332, in xisdir
                  raise NotImplementedError("os.path.isdir is not extended to support URLs in streaming mode")
              NotImplementedError: os.path.isdir is not extended to support URLs in streaming mode

Need help to make the dataset viewer work? Open an discussion for direct support.

Dataset Card for "tiny_shakespeare"

Dataset Summary

40,000 lines of Shakespeare from a variety of Shakespeare's plays. Featured in Andrej Karpathy's blog post 'The Unreasonable Effectiveness of Recurrent Neural Networks':

To use for e.g. character modelling:

d = datasets.load_dataset(name='tiny_shakespeare')['train']
d = x: datasets.Value('strings').unicode_split(x['text'], 'UTF-8'))
# train split includes vocabulary for other splits
vocabulary = sorted(set(next(iter(d)).numpy()))
d = x: {'cur_char': x[:-1], 'next_char': x[1:]})
d = d.unbatch()
seq_len = 100
batch_size = 2
d = d.batch(seq_len)
d = d.batch(batch_size)

Supported Tasks and Leaderboards

More Information Needed


More Information Needed

Dataset Structure

Data Instances


  • Size of downloaded dataset files: 1.06 MB
  • Size of the generated dataset: 1.06 MB
  • Total amount of disk used: 2.13 MB

An example of 'train' looks as follows.

    "text": "First Citizen:\nBefore we proceed any further, hear me "

Data Fields

The data fields are the same among all splits.


  • text: a string feature.

Data Splits

name train validation test
default 1 1 1

Dataset Creation

Curation Rationale

More Information Needed

Source Data

Initial Data Collection and Normalization

More Information Needed

Who are the source language producers?

More Information Needed


Annotation process

More Information Needed

Who are the annotators?

More Information Needed

Personal and Sensitive Information

More Information Needed

Considerations for Using the Data

Social Impact of Dataset

More Information Needed

Discussion of Biases

More Information Needed

Other Known Limitations

More Information Needed

Additional Information

Dataset Curators

More Information Needed

Licensing Information

More Information Needed

Citation Information

  author={Karpathy, Andrej},


Thanks to @thomwolf, @lewtun, @patrickvonplaten for adding this dataset.

Downloads last month

Models trained or fine-tuned on tiny_shakespeare