Load fine-tuned LM without the head?
Is there a way to load a fine-tuned model without the head? I just need the fine-tuned LM, without the head to use it in another context – I mean the task head.I used the Trainer API, with a predefined AutoModelFor*.
2022-02-22T02:11:54Z
HiEvery model that inheritsPreTrainedModelhas abase_modelproperty. For example, if you have aBertForSequenceClassificationmodel namedmodel, thenmodel.base_modelwill give you aBertModel, which is exactlyBertForSequenceClassificationminus the classification layer at the end.
2022-02-22T13:05:45Z
Thank you@beneyal