Downloads · 30 days
126K
2% of all-time downloads
trl-internal-testing/dummy-GPT2-correct-vocab
dummy-GPT2-correct-vocab is a text generation model from trl-internal-testing. Use it when you need the model to write or continue text. It is set up for transformers.
Downloads · 30 days
126K
2% of all-time downloads
All-time downloads
8M
Public
Parameters
1.7M
62.4 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors6.6 MB · 66%
From the Hugging Face model README
from transformers import AutoTokenizer, GPT2Config, GPT2LMHeadModel
config = GPT2Config(n_positions=512, n_embd=32, n_layer=5, n_head=4, n_inner=37, pad_token_id=1023, is_decoder=True)
model = GPT2LMHeadModel(config)
tokenizer = AutoTokenizer.from_pretrained("openai-community/gpt2")
model_id = "trl-internal-testing/dummy-GPT2-correct-vocab"
model.push_to_hub(model_id)
tokenizer.chat_template = "{% for message in messages %}{% if message['role'] == 'user' %}{{ ' ' }}{% endif %}{{ message['content'] }}{% if not loop.last %}{{ ' ' }}{% endif %}{% endfor %}{{ eos_token }}"
tokenizer.push_to_hub(model_id)
config.push_to_hub(model_id)