Downloads · 30 days
67
17% of all-time downloads
Deepjyoti/shakespeare-GPT
shakespeare-GPT is a text generation model from Deepjyoti. Use it when you need the model to write or continue text. The card lists the license as other.
A small, self-contained character-level GPT trained on Tiny Shakespeare.
Downloads · 30 days
67
17% of all-time downloads
All-time downloads
393
Public
Parameters
4.8M
38.4 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors19.2 MB · 100%
From the Hugging Face model README
A small, self-contained character-level GPT trained on Tiny Shakespeare.
This is a plain PyTorch model. It does not use the transformers,
accelerate, peft, or trl libraries.
git clone <model-repository>
cd shakespeare-GPT
pip install -r requirements.txt
python inference.py --prompt "ROMEO:"
pip install -r requirements.txt
Requirements:
torchsafetensorshuggingface_hubRun inference with a prompt (the model continues the text):
python inference.py --prompt "ROMEO:"
Optional sampling flags:
python inference.py \
--prompt "ROMEO:" \
--max-new-tokens 200 \
--temperature 0.8 \
--top-k 40
Supported generation parameters:
--max-new-tokens — number of tokens to generate--temperature — sampling temperature (0.0 = greedy)--top-k — top-k sampling filter--top-p — nucleus sampling filter--seed — seed for reproducible samplingpython inference.py \
--device cpu \
--prompt "ROMEO:"
The model runs on CPU with no special setup. It is slower than GPU but works on any machine.
python inference.py \
--device cuda \
--prompt "ROMEO:"
CUDA is used automatically when available; the model never requires it.
The weights are stored as a Git LFS object. If you git clone this repo,
install git-lfs first or you will only get small LFS pointer files:
git lfs install
git clone https://huggingface.co/Deepjyoti/shakespeare-GPT
cd shakespeare-GPT
pip install -r requirements.txt
python inference.py --prompt "ROMEO:"
Alternatively, download the files with the hf / huggingface_hub tooling
(no git-lfs needed):
pip install -r requirements.txt
# hf CLI
hf download Deepjyoti/shakespeare-GPT --local-dir .
# or Python
python -c "from huggingface_hub import snapshot_download; snapshot_download('Deepjyoti/shakespeare-GPT', local_dir='.')"
You can also let inference.py fetch the weights automatically:
python inference.py \
--model-id Deepjyoti/shakespeare-GPT \
--prompt "ROMEO:"
A convenience script that downloads everything into a local cache and runs inference:
python download_and_run.py \
--model-id Deepjyoti/shakespeare-GPT \
--prompt "ROMEO:"
README.md
config.json # model hyper-parameters
metadata.json # training metadata
model.safetensors # inference weights
model.py # standalone model implementation
tokenizer.py # tokenizer implementation
tokenizer.json # token-to-id mapping
inference.py # inference entry point
download_and_run.py # download-and-infer convenience script
requirements.txt
tests/ # tokenizer, loading, generation, and CPU tests
pip install pytest
python -m pytest tests -q
This is an experimental research model. Please keep expectations appropriate:
Do not rely on it for factual or creative writing.