My Fine-tuned GPT-2 Medium
This repository contains a GPT-2 Medium model fine-tuned on custom instruction data using PyTorch and Hugging Face Transformers.
Model Details
- Base model: GPT-2 Medium (355M)
- Architecture: Standard GPT-2 (24 layers, 1024 embedding dim, 16 heads)
- Tokenizer: Uses the default GPT-2 tokenizer
- Format: Hugging Face Transformers-compatible (model.safetensors, config.json)
Usage
You can load and use this model directly with Hugging Face Transformers:
from transformers import GPT2LMHeadModel, GPT2Tokenizer
model = GPT2LMHeadModel.from_pretrained("sweatSmile/my-finetuned-gpt2-medium")
tokenizer = GPT2Tokenizer.from_pretrained("gpt2-medium")
prompt = "Below is an instruction that describes a task.\n\n### Instruction:\nWrite a poem about spring."
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Files
model.safetensors: Model weightsconfig.json: Model configurationgeneration_config.json: Generation parameters
License
This model is released under the Apache 2.0 license.
Author
- sweatSmile
For questions or issues, please open an issue on the Hugging Face repo.
- Downloads last month
- 27
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 1 Ask for provider support
Model tree for sweatSmile/my-finetuned-gpt2-medium
Base model
openai-community/gpt2-medium