Downloads · 30 days
10
14% of all-time downloads
Easonwangzk/gpt2-dolly-15k-instruct
gpt2-dolly-15k-instruct is a text generation model from Easonwangzk. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
10
14% of all-time downloads
All-time downloads
72
Public
Parameters
124M
498 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors498 MB · 99%
From the Hugging Face model README
This repository contains a GPT-2 model fine-tuned on the Databricks Dolly 15K dataset to improve instruction-following capabilities. The goal is to transform a small, general-purpose language model into a lightweight instruction model that can:
Base model: gpt2
Fine-tuned by: Easonwangzk
Dataset: databricks/databricks-dolly-15k
This model is suitable for educational purposes, prototyping, and research on instruction-tuned models with limited parameters.
The model is trained on the Databricks Dolly 15K dataset:
During preprocessing, each example is converted into a single text sequence in the format:
Instruction: <instruction text>
Context: <context text if available>
Response: <response text>
If no context is available, the Context section is omitted and only Instruction and Response are used.
Base model: gpt2 (117M parameters)
Objective: Causal language modeling (next-token prediction)
Key training hyperparameters (example values):
Padding and special tokens:
This model is intended for:
It is not intended for:
Basic inference example (Python):
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_name = "Easonwangzk/gpt2-dolly-15k-instruct"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name).to(
"cuda" if torch.cuda.is_available() else "cpu"
)
def generate_response(instruction, max_new_tokens=200):
prompt = f"Instruction:\\instruction\\n\\nResponse:\\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=max_new_tokens,
do_sample=True,
temperature=0.7,
top_p=0.9,
pad_token_id=tokenizer.eos_token_id,
)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
instruction = "List 3 use cases for blockchain."
print(generate_response(instruction))
For best results, prompts should follow the same structure used during training:
Instruction:
<your instruction here>
Response:
If there is additional context, you can include:
Instruction:
<your instruction here>
Context:
<relevant background or input>
Response:
The model has been evaluated on prompts such as:
Compared to the original GPT-2 model, the fine-tuned model:
Users should:
If you use this model or the training pipeline in academic or industrial work, please consider citing:
Model author: Easonwangzk