Downloads · 30 days
2
13% of all-time downloads
Edureka123/distilgpt2-finetuned-demo
distilgpt2-finetuned-demo is a machine learning model from Edureka123. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains a fine-tuned DistilGPT2 language model, trained on a small domain-style corpus with educational / AI agent related text.
Downloads · 30 days
2
13% of all-time downloads
All-time downloads
16
Public
Parameters
81.9M
983 MB on disk
Likes
0
Public
Click a slice to open those files.
.pt655 MB · 50%
From the Hugging Face model README
This repository contains a fine-tuned DistilGPT2 language model, trained on a small domain-style corpus with educational / AI agent related text.
distilgpt2transformersPyTorchEpochs: 1
Batch size: 2 (with gradient accumulation)
Learning rate: 5e-5
Weight decay: 0.01
Dataset: Small custom text corpus (educational / AI topics)
Eval loss: 5.8886
Approx. perplexity: 360.89
You can load and generate text with this model using transformers:
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "REPLACE_WITH_YOUR_USERNAME/REPLACE_WITH_REPO_NAME"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
prompt = "In the future, AI personal assistants will"
inputs = tokenizer(prompt, return_tensors="pt")
output_ids = model.generate(
**inputs,
max_length=80,
do_sample=True,
top_p=0.9,
temperature=0.8,
)
print(tokenizer.decode(output_ids[0], skip_special_tokens=True))