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

bert_base_zh, bert_base_multi_cased: Add BERT Base Variants #319

Merged
merged 17 commits into from
Sep 1, 2022

Conversation

abheesht17
Copy link
Collaborator

@abheesht17 abheesht17 commented Aug 27, 2022

Resolves #308

Converted model weights and vocab have been uploaded here: https://drive.google.com/drive/folders/19APUi7fobORdQjoe8YDyk8ou0x_L6hWu?usp=sharing.

Edit: Merging #320 with this PR. Might cause conflicts while merging with master, otherwise.

@mattdangerw
Copy link
Member

@abheesht17 I think we would want to avoid the add_pooling_layer parameter if possible.

One thing we could check is the bert checkpoints on the original bert repo. Could you see if those include the pooling layer?

https://github.com/google-research/bert

@abheesht17
Copy link
Collaborator Author

@abheesht17 I think we would want to avoid the add_pooling_layer parameter if possible.

One thing we could check is the bert checkpoints on the original bert repo. Could you see if those include the pooling layer?

https://github.com/google-research/bert

My bad. The pooling layers are present in this ckpt after all: https://storage.googleapis.com/tf_model_garden/nlp/bert/v3/multi_cased_L-12_H-768_A-12.tar.gz. Missed them earlier

@abheesht17 abheesht17 changed the title Add Checkpoint Conversion Notebook for bert_base_chinese bert_base_chinese, bert_base_multi_cased: Add Checkpoint Conversion Notebooks Aug 31, 2022
@abheesht17 abheesht17 changed the title bert_base_chinese, bert_base_multi_cased: Add Checkpoint Conversion Notebooks bert_base_zh, bert_base_multi_cased: Add Checkpoint Conversion Notebooks Aug 31, 2022
@abheesht17 abheesht17 changed the title bert_base_zh, bert_base_multi_cased: Add Checkpoint Conversion Notebooks bert_base_zh, bert_base_multi_cased: Add BERT Variants Aug 31, 2022
@abheesht17 abheesht17 changed the title bert_base_zh, bert_base_multi_cased: Add BERT Variants bert_base_zh, bert_base_multi_cased: Add BERT Base Variants Aug 31, 2022
Copy link
Member

@mattdangerw mattdangerw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! We recently renamed the inputs to the models, could you make the changes in your colab to match?
#327

I think we are fine with the weights we have now (as the variable names do not depend on the input names), but might be good to double check the rename did not break the weights we uploaded.

" )\n",
"\n",
"model.get_layer(\"pooled_dense\").kernel.assign(\n",
" weights[f\"encoder/layer_with_weights-{i + 5}/kernel/.ATTRIBUTES/VARIABLE_VALUE\"]\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is using a variable (i) that is not out of scope. Can't you just do num_layers + X?

Same comment for other colab.

Copy link
Member

@mattdangerw mattdangerw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! Thanks!

@mattdangerw mattdangerw merged commit 6953e53 into keras-team:master Sep 1, 2022
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

Successfully merging this pull request may close these issues.

Add pretrained checkpoints for multilingual and Chinese BERT
2 participants