File size: 358 Bytes
4cb5654
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from transformers import AutoConfig

from modeling.modeling_gpt2 import GPT2CustomLMHeadModel

cfg = AutoConfig.from_pretrained("hf-internal-testing/tiny-random-gpt2")

GPT2CustomLMHeadModel.register_for_auto_class("AutoModelForCausalLM")

model = GPT2CustomLMHeadModel(cfg)
model.save_pretrained("/home/fxmarty/hf_internship/tiny-testing-gpt2-remote-code")