How to use 1 model for 2 downstream tasks?

Hello. I am using pretrained model for text generation and seq classification. The workflow is TEXT -(task 1)-> NEW TEXT -(task 2)-> CLASS. I would like to use the same pretrained model for both tasks, e.g., GPT2.
It works if I create 2 models using AutoModelWithLMHead and AutoModelForSequenceClassification, but it takes 2x spaces. Is there any method to share the common parameters of 2 models?