metadata
library_name: transformers
tags: []
Model Card for Model ID
Fine tuning (learning/educational) results of GPT2-medium on a customized dataset
Testing different ways to provide a though process withing GPT2
This one seemed like the best results for now..
Model Details
Base model : 'hf_models/gpt2-medium'
Direct Use
from transformers import GPT2LMHeadModel, GPT2Tokenizer
models_folder = "Deeokay/gpt2-javis-stks"
# if you know your device, you can just set "device = 'mps'"
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = GPT2LMHeadModel.from_pretrained(models_folder)
tokenizer = GPT2Tokenizer.from_pretrained(models_folder)
tokenizer.pad_token = tokenizer.eos_token
prompt = "what is the meaning of life?"
inputs = tokenizer(prompt, return_tensors="pt", padding=True, truncation=True).to(device)
set_seed(42)
sample_output = model.generate(
**inputs,
max_new_tokens=250,
do_sample=True,
top_k=30,
temperature=0.7,
)
print("Output:\n" + 80 * '-')
print(tokenizer.decode(sample_output[0], skip_special_tokens=True))
[More Information Needed]
Training Details
Training Data
[More Information Needed]