Open anentropic opened 1 year ago
For more context... I noticed that some of the other LMHeadModel classes have a note:
works OK with coremltools commit 50c5569, breaks with later versions
It looks like that commit was added between coremltools versions 6.0 and 6.1
so I installed compatible package versions:
pip install torch==1.12.1
pip install numpy==1.23.5
pip install coremltools==6.0
also:
coreml_config = GPT2CoreMLConfig(
base_model.config,
task="causal-lm",
use_past=False,
)
but I still get:
ValueError: Op "137" (op_type: fill) Input shape="136" expects tensor or scalar of dtype from type domain ['int32'] but got tensor[0,fp32]
I get this error when trying to convert
gpt2
I first tried:
Next I tried:
But they both give the same error
I realise this repo is WIP, but I had seen the list here saying GPT2 model is supported: https://github.com/huggingface/exporters/blob/main/MODELS.md