How to find the path of a model?
I access a specific model with this code:model = GPT2LMHeadModel.from_pretrained('gpt2-xl')I would like to export this model to ONNX using the Optimum utility.  But this utility requires the model ID on hugging face.  Here is the syntax.  How do I find the ID?  Thanks.optimum-cli export onnx --model <model ID on hugging face>
2024-02-22T20:57:42Z
Wouldn’t it just begpt2-xlin this case?optimum-cli export onnx --model gpt2-xl
2024-02-23T15:48:23Z
That works, but it will use the base model of gpt2-xl.  What I want is the model with the language modeling head (GPT2LMHeadModel).  Using the name of the language modeling head in the optimum command does not work.I’ve come up with a bypass.  Download the model to my local drive, and then use optimum to point to the model file.
2024-02-23T17:05:04Z
@runskiI see, in that case you can specify the task the CLI with the--taskarg to make sure it’s the version with the LM head. E.g.,optimum-cli export onnx --model gpt2-xl --task text-generationoroptimum-cli export onnx --model gpt2-xl --task text-generation-with-pastThere’s also a tableherethat shows which HF classes the different “tasks” map to with the optimum CLI
2024-02-23T21:10:26Z
It’s not obvious --text generation maps to LMHead.  I wish the documentation is clear about it.