Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I use "BertForQuestionAnswering.from_pretrained" #2

Open
wulaoshi opened this issue Apr 16, 2020 · 1 comment
Open

When I use "BertForQuestionAnswering.from_pretrained" #2

wulaoshi opened this issue Apr 16, 2020 · 1 comment

Comments

@wulaoshi
Copy link

When I use "BertForQuestionAnswering.from_pretrained" to import my pytorch_model.bin, there having a error "tarfile.ReadError: not a gzip file".So, what should I do to use my pytorch_model.bin? Thanks.

@wulaoshi
Copy link
Author

When I use "BertForQuestionAnswering.from_pretrained" to import my pytorch_model.bin, there having a error "tarfile.ReadError: not a gzip file".So, what should I do to use my pytorch_model.bin? Thanks.

Just like these:
Model_path = "../chinese_roberta_wwm_large_ext_pytorch/pytorch_model.bin"
bert_config = BertConfig.from_pretrained(args.config_path, output_hidden_states=False)
tokenizer = BertTokenizer.from_pretrained(args.vocab_path, config=bert_config)
model = BertForQuestionAnswering.from_pretrained(Model_path , config=bert_config)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant