alibaba / AliceMind

ALIbaba's Collection of Encoder-decoders from MinD (Machine IntelligeNce of Damo) Lab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can sdcup models be called by transformers interface?

michaelxu1107 opened this issue · comments

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

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

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'

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