how i pass from an AutoModelWithLMHead to a GPT2DoubleHeadsModel ?
I used your script of run_language_modeling.py to train a gpt2 model from scratch. Here i save it and upload:

from transformers import AutoModelWithLMHead, AutoTokenizer
import os
directory = "./checkpoint"
model = AutoModelWithLMHead.from_pretrained(directory)
tokenizer = AutoTokenizer.from_pretrained(directory)
out = "gpt_2"
os.makedirs(out, exist_ok=True)
model.save_pretrained(out)
tokenizer.save_pretrained(out)
!transformers-cli upload ./gpt_2/

After if i want to use it for fine-tuning in a specific task and i want to use a GPT2DoubleHeadsModel
i can just load it like this?

from transformers import GPT2DoubleHeadsModel,GPT2Tokenizer
model = GPT2DoubleHeadsModel.from_pretrained("ex/gpt_2")
tokenizer = GPT2Tokenizer.from_pretrained("ex/gpt_2")

Or it will not load the weights?
It will load the weights, but will not load the multiple choice head as it's not in the checkpoint. That's why fine-tuning it is a good idea, so that this head's weights get trained!