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

Added model card links for all pretrained models. #795

Merged
merged 6 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions keras_nlp/models/albert/albert_presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"params": 11683584,
"official_name": "ALBERT",
"path": "albert",
"model_card": "https://github.com/google-research/albert/blob/master/README.md",
},
"config": {
"vocabulary_size": 30000,
Expand Down Expand Up @@ -53,6 +54,7 @@
"params": 17683968,
"official_name": "ALBERT",
"path": "albert",
"model_card": "https://github.com/google-research/albert/blob/master/README.md",
},
"config": {
"vocabulary_size": 30000,
Expand Down Expand Up @@ -82,6 +84,7 @@
"params": 58724864,
"official_name": "ALBERT",
"path": "albert",
"model_card": "https://github.com/google-research/albert/blob/master/README.md",
},
"config": {
"vocabulary_size": 30000,
Expand Down Expand Up @@ -111,6 +114,7 @@
"params": 222595584,
"official_name": "ALBERT",
"path": "albert",
"model_card": "https://github.com/google-research/albert/blob/master/README.md",
},
"config": {
"vocabulary_size": 30000,
Expand Down
38 changes: 20 additions & 18 deletions keras_nlp/models/bart/bart_presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@

backbone_presets = {
"bart_base_en": {
"metadata": {
"description": (
"6-layer BART model where case is maintained. "
"Trained on BookCorpus, English Wikipedia and CommonCrawl."
),
"params": 139417344,
"official_name": "BART",
"path": "bart",
"model_card": "https://github.com/facebookresearch/fairseq/blob/main/examples/bart/README.md",
},
"config": {
"vocabulary_size": 50265,
"num_layers": 6,
Expand All @@ -25,15 +35,6 @@
"max_sequence_length": 1024,
},
"preprocessor_config": {},
"metadata": {
"description": (
"6-layer BART model where case is maintained. "
"Trained on BookCorpus, English Wikipedia and CommonCrawl."
),
"params": 139417344,
"official_name": "BART",
"path": "bart",
},
"weights_url": "https://storage.googleapis.com/keras-nlp/models/bart_base_en/v1/model.h5",
"weights_hash": "5b59403f0cafafbd89680e0785791163",
"vocabulary_url": "https://storage.googleapis.com/keras-nlp/models/bart_base_en/v1/vocab.json",
Expand All @@ -42,6 +43,16 @@
"merges_hash": "75a37753dd7a28a2c5df80c28bf06e4e",
},
"bart_large_en": {
"metadata": {
"description": (
"12-layer BART model where case is maintained. "
"Trained on BookCorpus, English Wikipedia and CommonCrawl."
),
"params": 406287360,
"official_name": "BART",
"path": "bart",
"model_card": "https://github.com/facebookresearch/fairseq/blob/main/examples/bart/README.md",
},
"config": {
"vocabulary_size": 50265,
"num_layers": 12,
Expand All @@ -52,15 +63,6 @@
"max_sequence_length": 1024,
},
"preprocessor_config": {},
"metadata": {
"description": (
"12-layer BART model where case is maintained. "
"Trained on BookCorpus, English Wikipedia and CommonCrawl."
),
"params": 406287360,
"official_name": "BART",
"path": "bart",
},
"weights_url": "https://storage.googleapis.com/keras-nlp/models/bart_large_en/v1/model.h5",
"weights_hash": "6bfe7e591af8c5699ce6f9f18753af9a",
"vocabulary_url": "https://storage.googleapis.com/keras-nlp/models/bart_large_en/v1/vocab.json",
Expand Down
10 changes: 10 additions & 0 deletions keras_nlp/models/bert/bert_presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"params": 4385920,
"official_name": "BERT",
"path": "bert",
"model_card": "https://github.com/google-research/bert/blob/master/README.md",
},
"config": {
"vocabulary_size": 30522,
Expand Down Expand Up @@ -53,6 +54,7 @@
"params": 28763648,
"official_name": "BERT",
"path": "bert",
"model_card": "https://github.com/google-research/bert/blob/master/README.md",
},
"config": {
"vocabulary_size": 30522,
Expand Down Expand Up @@ -81,6 +83,7 @@
"params": 41373184,
"official_name": "BERT",
"path": "bert",
"model_card": "https://github.com/google-research/bert/blob/master/README.md",
},
"config": {
"vocabulary_size": 30522,
Expand Down Expand Up @@ -109,6 +112,7 @@
"params": 109482240,
"official_name": "BERT",
"path": "bert",
"model_card": "https://github.com/google-research/bert/blob/master/README.md",
},
"config": {
"vocabulary_size": 30522,
Expand Down Expand Up @@ -137,6 +141,7 @@
"params": 108310272,
"official_name": "BERT",
"path": "bert",
"model_card": "https://github.com/google-research/bert/blob/master/README.md",
},
"config": {
"vocabulary_size": 28996,
Expand Down Expand Up @@ -164,6 +169,7 @@
"params": 102267648,
"official_name": "BERT",
"path": "bert",
"model_card": "https://github.com/google-research/bert/blob/master/README.md",
},
"config": {
"vocabulary_size": 21128,
Expand Down Expand Up @@ -191,6 +197,7 @@
"params": 177853440,
"official_name": "BERT",
"path": "bert",
"model_card": "https://github.com/google-research/bert/blob/master/README.md",
},
"config": {
"vocabulary_size": 119547,
Expand Down Expand Up @@ -219,6 +226,7 @@
"params": 335141888,
"official_name": "BERT",
"path": "bert",
"model_card": "https://github.com/google-research/bert/blob/master/README.md",
},
"config": {
"vocabulary_size": 30522,
Expand Down Expand Up @@ -247,6 +255,7 @@
"params": 333579264,
"official_name": "BERT",
"path": "bert",
"model_card": "https://github.com/google-research/bert/blob/master/README.md",
},
"config": {
"vocabulary_size": 28996,
Expand Down Expand Up @@ -277,6 +286,7 @@
"params": 4385920,
"official_name": "BERT",
"path": "bert",
"model_card": "https://github.com/google-research/bert/blob/master/README.md",
},
"config": {
"backbone": {
Expand Down
89 changes: 47 additions & 42 deletions keras_nlp/models/deberta_v3/deberta_v3_presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@

backbone_presets = {
"deberta_v3_extra_small_en": {
"metadata": {
"description": (
"12-layer DeBERTaV3 model where case is maintained. "
"Trained on English Wikipedia, BookCorpus and OpenWebText."
),
"params": 70682112,
"official_name": "DeBERTaV3",
"path": "deberta_v3",
"model_card": "https://huggingface.co/microsoft/deberta-v3-xsmall",
},
"config": {
"vocabulary_size": 128100,
"num_layers": 12,
Expand All @@ -26,21 +36,22 @@
"bucket_size": 256,
},
"preprocessor_config": {},
"weights_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_extra_small_en/v1/model.h5",
"weights_hash": "d8e10327107e5c5e20b45548a5028619",
"spm_proto_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_extra_small_en/v1/vocab.spm",
"spm_proto_hash": "1613fcbf3b82999c187b09c9db79b568",
},
"deberta_v3_small_en": {
Comment on lines +39 to +44
Copy link
Collaborator

Choose a reason for hiding this comment

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

There seems to be a lot of code delta unrelated to the change we want to make in this PR. We should avoid making such changes. Make only those changes which are necessary for the PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have rearranged dictionary orders so that metadata comes first in order to make it consistent with other presets, there is not much change apart from that.

"metadata": {
"description": (
"12-layer DeBERTaV3 model where case is maintained. "
"6-layer DeBERTaV3 model where case is maintained. "
"Trained on English Wikipedia, BookCorpus and OpenWebText."
),
"params": 70682112,
"params": 141304320,
"official_name": "DeBERTaV3",
"path": "deberta_v3",
"model_card": "https://huggingface.co/microsoft/deberta-v3-small",
},
"weights_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_extra_small_en/v1/model.h5",
"weights_hash": "d8e10327107e5c5e20b45548a5028619",
"spm_proto_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_extra_small_en/v1/vocab.spm",
"spm_proto_hash": "1613fcbf3b82999c187b09c9db79b568",
},
"deberta_v3_small_en": {
"config": {
"vocabulary_size": 128100,
"num_layers": 6,
Expand All @@ -52,21 +63,22 @@
"bucket_size": 256,
},
"preprocessor_config": {},
"weights_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_small_en/v1/model.h5",
"weights_hash": "84118eb7c5a735f2061ecccaf71bb888",
"spm_proto_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_small_en/v1/vocab.spm",
"spm_proto_hash": "1613fcbf3b82999c187b09c9db79b568",
},
"deberta_v3_base_en": {
"metadata": {
"description": (
"6-layer DeBERTaV3 model where case is maintained. "
"12-layer DeBERTaV3 model where case is maintained. "
"Trained on English Wikipedia, BookCorpus and OpenWebText."
),
"params": 141304320,
"params": 183831552,
"official_name": "DeBERTaV3",
"path": "deberta_v3",
"model_card": "https://huggingface.co/microsoft/deberta-v3-base",
},
"weights_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_small_en/v1/model.h5",
"weights_hash": "84118eb7c5a735f2061ecccaf71bb888",
"spm_proto_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_small_en/v1/vocab.spm",
"spm_proto_hash": "1613fcbf3b82999c187b09c9db79b568",
},
"deberta_v3_base_en": {
"config": {
"vocabulary_size": 128100,
"num_layers": 12,
Expand All @@ -78,21 +90,22 @@
"bucket_size": 256,
},
"preprocessor_config": {},
"weights_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_base_en/v1/model.h5",
"weights_hash": "cebce044aeed36aec9b94e3b8a255430",
"spm_proto_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_base_en/v1/vocab.spm",
"spm_proto_hash": "1613fcbf3b82999c187b09c9db79b568",
},
"deberta_v3_large_en": {
"metadata": {
"description": (
"12-layer DeBERTaV3 model where case is maintained. "
"24-layer DeBERTaV3 model where case is maintained. "
"Trained on English Wikipedia, BookCorpus and OpenWebText."
),
"params": 183831552,
"params": 434012160,
"official_name": "DeBERTaV3",
"path": "deberta_v3",
"model_card": "https://huggingface.co/microsoft/deberta-v3-large",
},
"weights_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_base_en/v1/model.h5",
"weights_hash": "cebce044aeed36aec9b94e3b8a255430",
"spm_proto_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_base_en/v1/vocab.spm",
"spm_proto_hash": "1613fcbf3b82999c187b09c9db79b568",
},
"deberta_v3_large_en": {
"config": {
"vocabulary_size": 128100,
"num_layers": 24,
Expand All @@ -104,21 +117,22 @@
"bucket_size": 256,
},
"preprocessor_config": {},
"metadata": {
"description": (
"24-layer DeBERTaV3 model where case is maintained. "
"Trained on English Wikipedia, BookCorpus and OpenWebText."
),
"params": 434012160,
"official_name": "DeBERTaV3",
"path": "deberta_v3",
},
"weights_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_large_en/v1/model.h5",
"weights_hash": "bce7690f358a9e39304f8c0ebc71a745",
"spm_proto_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_large_en/v1/vocab.spm",
"spm_proto_hash": "1613fcbf3b82999c187b09c9db79b568",
},
"deberta_v3_base_multi": {
"metadata": {
"description": (
"12-layer DeBERTaV3 model where case is maintained. "
"Trained on the 2.5TB multilingual CC100 dataset."
),
"params": 278218752,
"official_name": "DeBERTaV3",
"path": "deberta_v3",
"model_card": "https://huggingface.co/microsoft/mdeberta-v3-base",
},
"config": {
"vocabulary_size": 251000,
"num_layers": 12,
Expand All @@ -130,15 +144,6 @@
"bucket_size": 256,
},
"preprocessor_config": {},
"metadata": {
"description": (
"12-layer DeBERTaV3 model where case is maintained. "
"Trained on the 2.5TB multilingual CC100 dataset."
),
"params": 278218752,
"official_name": "DeBERTaV3",
"path": "deberta_v3",
},
"weights_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_base_multi/v1/model.h5",
"weights_hash": "26e5a824b26afd2ee336835bd337bbeb",
"spm_proto_url": "https://storage.googleapis.com/keras-nlp/models/deberta_v3_base_multi/v1/vocab.spm",
Expand Down
3 changes: 3 additions & 0 deletions keras_nlp/models/distil_bert/distil_bert_presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"params": 66362880,
"official_name": "DistilBERT",
"path": "distil_bert",
"model_card": "https://huggingface.co/distilbert-base-uncased",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of linking this, let's link the model card explicitly, So, in this case, https://huggingface.co/distilbert-base-uncased#distilbert-base-model-uncased. Same for other DistilBERT presets.

Copy link
Member

Choose a reason for hiding this comment

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

I'm ok with the main link actually. What is here is what you get when you click the model card tab on huggingface. (and i would somewhat suspect that anchor link might change down the link anyway)

},
"config": {
"vocabulary_size": 30522,
Expand Down Expand Up @@ -52,6 +53,7 @@
"params": 65190912,
"official_name": "DistilBERT",
"path": "distil_bert",
"model_card": "https://huggingface.co/distilbert-base-cased",
},
"config": {
"vocabulary_size": 28996,
Expand All @@ -78,6 +80,7 @@
"params": 134734080,
"official_name": "DistilBERT",
"path": "distil_bert",
"model_card": "https://huggingface.co/distilbert-base-multilingual-cased",
},
"config": {
"vocabulary_size": 119547,
Expand Down
Loading