gpt-2-Pytorch icon indicating copy to clipboard operation
gpt-2-Pytorch copied to clipboard

How do I modify to run with gpt2-xl (1558M) parameters?

Open jmarsil opened this issue 4 years ago • 3 comments

Any help would be greatly appreciated!

jmarsil avatar Nov 21 '19 23:11 jmarsil

I was able to find the s3 bucket locations of the pretrained GPT2 models here: https://github.com/huggingface/transformers/blob/master/transformers/modeling_gpt2.py (provided by HuggingFace).

To make this work, just download gpt2-xl model instead:

curl --output gpt2-pytorch_model.bin https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-xl-pytorch_model.bin

jasonzhou1 avatar Dec 01 '19 03:12 jasonzhou1

@jasonzhou1 I only get gibberish output with the XL model, worse than the small version. Have you actually had any luck with it?

Update: also tried the other models linked to in the script you referenced, also without luck.

paulbricman avatar Dec 17 '19 17:12 paulbricman

@jasonzhou1 I only get gibberish output with the XL model, worse than the small version. Have you actually had any luck with it?

Before you try gpt-2-ml model,some parameters in gpt-2-Pytorch/GPT2/config.py should be modified , like n-heads=25 , n_embd=1600 , n_layer=25, or you can see details here https://s3.amazonaws.com/models.huggingface.co/bert/gpt2-xl-config.json

ZJiaBin avatar Mar 09 '20 06:03 ZJiaBin