File size: 255 Bytes
ba077a6
2fe4305
ba077a6
 
1
2
3
4
5
from transformers import GPT2LMHeadModel, GPT2Tokenizer

model = GPT2LMHeadModel.from_pretrained("path_to_model")  # Replace with the path to your model
tokenizer = GPT2Tokenizer.from_pretrained("path_to_model")  # Replace with the path to your tokenizer