CoolFace
Modelpublic

ruhook/test-ruhook

sourceHugging Facemitupdated 17d agoView on Hugging Face
1likes1.3kdownloads
README.md37 linesDownload Raw Back to root
1---2license: mit3library_name: transformers4pipeline_tag: text-generation5language:6- en7tags:8- testing9- random-initialization10- gpt211---12# Tiny random GPT-2 for testing13 14This model is randomly initialized and **has not been trained**. It is for15testing upload, download, tokenization, and model loading only. Its output is16not meaningful and it is not suitable for real language tasks or benchmarking.17No pretrained model weights or training datasets were used.18 19Architecture: 1 GPT-2 layer, 1 attention head, 16 hidden dimensions,2032 vocabulary tokens, and a maximum context length of 64 tokens.21Parameter count: 3792.22 23## Usage24```python25from transformers import AutoTokenizer, AutoModelForCausalLM26 27repo = "ruhook/test-ruhook"28tokenizer = AutoTokenizer.from_pretrained(repo)29model = AutoModelForCausalLM.from_pretrained(repo)30inputs = tokenizer("hello world", return_tensors="pt")31outputs = model.generate(**inputs, max_new_tokens=5, do_sample=False)32print(tokenizer.decode(outputs[0], skip_special_tokens=True))33```34 35Validated locally with Python 3, torch 2.2.2 and transformers 4.46.3.36The toy word-level tokenizer maps words outside its small vocabulary to UNK.37