Closed johntzwei closed 1 year ago
Use pip install transformers==4.30.2
transformers>=4.31.0
:
ipdb> hf_layer.state_dict().keys()
odict_keys(['input_layernorm.weight', 'input_layernorm.bias', 'post_attention_layernorm.weight', 'post_attention_layernorm.bias', 'attention.rotary_emb.inv_freq', 'attention.query_key_value.weight', 'attention.query_key_value.bias', 'attention.dense.weight', 'attention.dense.bias', 'mlp.dense_h_to_4h.weight', 'mlp.dense_h_to_4h.bias', 'mlp.dense_4h_to_h.weight', 'mlp.dense_4h_to_h.bias'])
transformers<=4.30.2
:
ipdb> hf_layer.state_dict().keys()
odict_keys(['input_layernorm.weight', 'input_layernorm.bias', 'post_attention_layernorm.weight', 'post_attention_layernorm.bias', 'attention.bias', 'attention.masked_bias', 'attention.rotary_emb.inv_freq', 'attention.query_key_value.weight', 'attention.query_key_value.bias', 'attention.dense.weight', 'attention.dense.bias', 'mlp.dense_h_to_4h.weight', 'mlp.dense_h_to_4h.bias', 'mlp.dense_4h_to_h.weight', 'mlp.dense_4h_to_h.bias'])
You can find missing 'attention.bias', 'attention.masked_bias' before transformers==4.30.2
.
Thanks so much @shuheikurita, I just made a PR to update the transformers version
Describe the bug A clear and concise description of what the bug is.
I encounter the following error when I am converting GPTNeoX models to Huggingface using the
tools/convert_module_to_hf.py
script.Expected behavior Successful conversion.
Proposed solution If you comment out lines 230 and 231, the script will run through. From an eyeballing of the results, it doesn't seem like language modelling performance seriously degraded. Could this be some code that was supposed to be taken out?
Additional context This is for a model trained with the config
configs/pythia/410m.yml