CoolFace
Modelpublic

fxmarty/tiny-testing-gpt2-remote-code

sourceHugging Faceapache-2.0updated 4y agoView on Hugging Face
1likes1.1kdownloads
create_model.py11 linesDownload Raw Back to root
1from transformers import AutoConfig2 3from modeling.modeling_gpt2 import GPT2CustomLMHeadModel4 5cfg = AutoConfig.from_pretrained("hf-internal-testing/tiny-random-gpt2")6 7GPT2CustomLMHeadModel.register_for_auto_class("AutoModelForCausalLM")8 9model = GPT2CustomLMHeadModel(cfg)10model.save_pretrained("/home/fxmarty/hf_internship/tiny-testing-gpt2-remote-code")11