File size: 301 Bytes
1f6a5b9
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
# load_pretrained_model.py
from transformers import AutoModelForCausalLM, AutoTokenizer

def load_model_and_tokenizer():
    model_name = "gpt-3"
    tokenizer = AutoTokenizer.from_pretrained(model_name)
    model = AutoModelForCausalLM.from_pretrained(model_name)
    return model, tokenizer