AliceMind icon indicating copy to clipboard operation
AliceMind copied to clipboard

can sdcup models be called by transformers interface?

Open michaelxu1107 opened this issue 2 years ago • 3 comments

can sdcup models be called by transformers interface? such as TapasForQuestionAnswering, thanks

michaelxu1107 avatar Jun 14 '22 07:06 michaelxu1107

Hello, you can convert the model format to huggingface using this script. Well, I also suggest you apply the offered code.

grygg avatar Jun 15 '22 02:06 grygg

hello, thanks for reply, but when I use script show above to convert model, it shows error below

$ python convert_bert_from_uer_to_huggingface.py --input_model_path "./sdcup_base_model.bin-50000" --output_model_path "./pytorch_model.bin" Traceback (most recent call last): File "/home/smart_qa/sdcup/convert_bert_from_uer_to_huggingface.py", line 82, in main() File "/home/smart_qa/sdcup/convert_bert_from_uer_to_huggingface.py", line 58, in main output_model["bert.embeddings.word_embeddings.weight"] = input_model["embedding.word_embedding.weight"] KeyError: 'embedding.word_embedding.weight'

michaelxu1107 avatar Jun 24 '22 09:06 michaelxu1107

You can print the key names of the loaded model, maybe you need alignment the key names.

grygg avatar Jun 24 '22 11:06 grygg