Run this model with HF Jobs
Run purplejedi/dungeongpt-tiny-pretrain on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/purplejedi/dungeongpt-tiny-pretrain. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/purplejedi/dungeongpt-tiny-pretrain on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/purplejedi/dungeongpt-tiny-pretrain. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/purplejedi/dungeongpt-tiny-pretrain. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use purplejedi/dungeongpt-tiny-pretrain with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use purplejedi/dungeongpt-tiny-pretrain with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="purplejedi/dungeongpt-tiny-pretrain")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("purplejedi/dungeongpt-tiny-pretrain") model = AutoModelForCausalLM.from_pretrained("purplejedi/dungeongpt-tiny-pretrain", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use purplejedi/dungeongpt-tiny-pretrain with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "purplejedi/dungeongpt-tiny-pretrain" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "purplejedi/dungeongpt-tiny-pretrain", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/purplejedi/dungeongpt-tiny-pretrain
- SGLang
How to use purplejedi/dungeongpt-tiny-pretrain with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "purplejedi/dungeongpt-tiny-pretrain" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "purplejedi/dungeongpt-tiny-pretrain", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "purplejedi/dungeongpt-tiny-pretrain" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "purplejedi/dungeongpt-tiny-pretrain", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use purplejedi/dungeongpt-tiny-pretrain with Docker Model Runner:
docker model run hf.co/purplejedi/dungeongpt-tiny-pretrain
DungeonGPT β Tiny Pretrained GPT (Experiment 01)
A small (~4.27M parameter) GPT-2-style causal Transformer pretrained from scratch in PyTorch on tabletop RPG scene cards (CJJones/RPG_Scenes_LLM_Synthetic), exported to standard Hugging Face GPT2LMHeadModel safetensors format (verified max absolute logit diff 7.15e-06 against the original PyTorch checkpoint dungeon_gpt_best.pt).
Provenance
- Source Repository:
sriramrathinavelu/DungeonGPT - Training Git Commit SHA:
a8acfb1fc821dfe6d51eae2c0e3774f64e384702 - Notebook:
notebooks/01_pretraining.ipynb - Dataset:
CJJones/RPG_Scenes_LLM_Synthetic(split="train", deduplicated to 2,500 scenes) - Split Identifier:
seed42_90_5_5(2,250 train / 125 val / 125 test, seed42) - Dataset Split SHA-256:
691c8d38c1dd270aa156d601e1d1d2cd1e0f5da08b5eca3761d5ded7ccc33196 - Weights & Biases Run: https://wandb.ai/chillyskywalker/dungeongpt/runs/cywyjr84
- Hardware:
Tesla T4
Model Architecture & Tokenizer
- From-Scratch Training Class:
dungeongpt.models.tiny_gpt.DungeonGPT(Pre-LN causal decoder, exact GELU, tied embeddings) - Hugging Face Format: Native
GPT2LMHeadModel(model.safetensors,config.json) +PreTrainedTokenizerFast(tokenizer.json,tokenizer_config.json) - Parameters:
4,268,800(all trainable) - Config:
vocab_size=4089,emb_dim=256,context_length=256,n_layers=4,n_heads=4 - Tokenizer: Custom ByteLevel BPE (
<|scene_start|>,<|scene_end|>)
Evaluation Metrics
| Metric | Value |
|---|---|
| Best Epoch | 13 |
| Best Validation Cross-Entropy Loss | 0.3667 |
| Best Validation Perplexity | 1.44 |
| Total Optimizer Steps | 1872 |
| Total Training Tokens Seen | 7,618,560 |
Known Limitations
- Pretrained purely with unconditional next-token prediction; does not reliably follow arbitrary instructions or maintain strict cross-field factual consistency between card headers and prose.
- Intended as an educational base checkpoint for Experiment 02 (
notebooks/02_sft.ipynb, Supervised Fine-Tuning with prompt loss masking).
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "purplejedi/dungeongpt-tiny-pretrain"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
prompt = "<|scene_start|>\nPrimary Setting: Haunted Castle\n"
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
output_ids = model.generate(
**inputs,
max_new_tokens=200,
do_sample=True,
temperature=0.8,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=tokenizer.pad_token_id,
)
print(tokenizer.decode(output_ids[0], skip_special_tokens=False))
- Downloads last month
- 37