Downloads · 30 days
16
19% of all-time downloads
csabakecskemeti/dq-gpt2-instruct-exp1
dq-gpt2-instruct-exp1 is a machine learning model from csabakecskemeti. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
A recreation of the GPT-2 model from scretch
Downloads · 30 days
16
19% of all-time downloads
All-time downloads
85
Public
Parameters
163M
3.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt4.5 GB · 93%
From the Hugging Face model README
A recreation of the GPT-2 model from scretch
Instruction fine-tuned GPT-2 model.
from transformers import GPT2LMHeadModel, GPT2Tokenizer
model = GPT2LMHeadModel.from_pretrained("csabakecskemeti/dq-gpt2-instruct-exp1")
tokenizer = GPT2Tokenizer.from_pretrained("gpt2") # Use standard GPT-2 tokenizer
# Generate text with instruction format
prompt = "### Instruction:\nWhat is Python?\n\n### Response:\n"
inputs = tokenizer.encode(prompt, return_tensors="pt")
outputs = model.generate(inputs, max_length=200, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
Model has pretrained on the fineweb-edu dataset and fine-tuned on the Alpaca GPT-4 dataset for instruction following.



DGX Spark