Download create_model.py from optimum-internal-testing/tiny-testing-gpt2-remote-code: direct link, hf CLI and curl.
- Browser
- Download file 358 Bytes
-
https://huggingface.co/optimum-internal-testing/tiny-testing-gpt2-remote-code/resolve/626f1527cc608fd13b72eddd06e5aefc19032b0b/create_model.py
- Command line
-
hf download hf://optimum-internal-testing/tiny-testing-gpt2-remote-code@626f1527cc608fd13b72eddd06e5aefc19032b0b/create_model.py
-
curl -L -o create_model.py https://huggingface.co/optimum-internal-testing/tiny-testing-gpt2-remote-code/resolve/626f1527cc608fd13b72eddd06e5aefc19032b0b/create_model.py
358 Bytes
| 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") | |