Skip to content

Commit d658112

Browse files
Autogenerate preset table (#690)
* Autogenerate preset table * Made suggested changes * Removed prev desc and formatted file. * Added official_name and paths to metadata * Formatted the code using black * Updated metadata for ALBERT, BART, DeBERTa, F_Net * Minor content updates * Format fixes * One last round of updates --------- Co-authored-by: Matt Watson <[email protected]>
1 parent 403ffd2 commit d658112

File tree

10 files changed

+340
-134
lines changed

10 files changed

+340
-134
lines changed

keras_nlp/models/albert/albert_presets.py

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616

1717
backbone_presets = {
1818
"albert_base_en_uncased": {
19+
"metadata": {
20+
"description": (
21+
"12-layer ALBERT model where all input is lowercased. "
22+
"Trained on English Wikipedia + BooksCorpus."
23+
),
24+
"params": 11683584,
25+
"official_name": "ALBERT",
26+
"path": "albert",
27+
},
1928
"config": {
2029
"vocabulary_size": 30000,
2130
"num_layers": 12,
@@ -30,16 +39,21 @@
3039
"num_segments": 2,
3140
},
3241
"preprocessor_config": {},
33-
"description": (
34-
"Base size of ALBERT where all input is lowercased. "
35-
"Trained on English Wikipedia + BooksCorpus."
36-
),
3742
"weights_url": "https://storage.googleapis.com/keras-nlp/models/albert_base_en_uncased/v1/model.h5",
3843
"weights_hash": "b83ccf3418dd84adc569324183176813",
3944
"spm_proto_url": "https://storage.googleapis.com/keras-nlp/models/albert_base_en_uncased/v1/vocab.spm",
4045
"spm_proto_hash": "73e62ff8e90f951f24c8b907913039a5",
4146
},
4247
"albert_large_en_uncased": {
48+
"metadata": {
49+
"description": (
50+
"24-layer ALBERT model where all input is lowercased. "
51+
"Trained on English Wikipedia + BooksCorpus."
52+
),
53+
"params": 17683968,
54+
"official_name": "ALBERT",
55+
"path": "albert",
56+
},
4357
"config": {
4458
"vocabulary_size": 30000,
4559
"num_layers": 24,
@@ -54,16 +68,21 @@
5468
"num_segments": 2,
5569
},
5670
"preprocessor_config": {},
57-
"description": (
58-
"Large size of ALBERT where all input is lowercased. "
59-
"Trained on English Wikipedia + BooksCorpus."
60-
),
6171
"weights_url": "https://storage.googleapis.com/keras-nlp/models/albert_large_en_uncased/v1/model.h5",
6272
"weights_hash": "c7754804efb245f06dd6e7ced32e082c",
6373
"spm_proto_url": "https://storage.googleapis.com/keras-nlp/models/albert_large_en_uncased/v1/vocab.spm",
6474
"spm_proto_hash": "73e62ff8e90f951f24c8b907913039a5",
6575
},
6676
"albert_extra_large_en_uncased": {
77+
"metadata": {
78+
"description": (
79+
"24-layer ALBERT model where all input is lowercased. "
80+
"Trained on English Wikipedia + BooksCorpus."
81+
),
82+
"params": 58724864,
83+
"official_name": "ALBERT",
84+
"path": "albert",
85+
},
6786
"config": {
6887
"vocabulary_size": 30000,
6988
"num_layers": 24,
@@ -78,16 +97,21 @@
7897
"num_segments": 2,
7998
},
8099
"preprocessor_config": {},
81-
"description": (
82-
"Extra Large size of ALBERT where all input is lowercased. "
83-
"Trained on English Wikipedia + BooksCorpus."
84-
),
85100
"weights_url": "https://storage.googleapis.com/keras-nlp/models/albert_extra_large_en_uncased/v1/model.h5",
86101
"weights_hash": "713209be8aadfa614fd79f18c9aeb16d",
87102
"spm_proto_url": "https://storage.googleapis.com/keras-nlp/models/albert_extra_large_en_uncased/v1/vocab.spm",
88103
"spm_proto_hash": "73e62ff8e90f951f24c8b907913039a5",
89104
},
90105
"albert_extra_extra_large_en_uncased": {
106+
"metadata": {
107+
"description": (
108+
"12-layer ALBERT model where all input is lowercased. "
109+
"Trained on English Wikipedia + BooksCorpus."
110+
),
111+
"params": 222595584,
112+
"official_name": "ALBERT",
113+
"path": "albert",
114+
},
91115
"config": {
92116
"vocabulary_size": 30000,
93117
"num_layers": 12,
@@ -102,10 +126,6 @@
102126
"num_segments": 2,
103127
},
104128
"preprocessor_config": {},
105-
"description": (
106-
"Extra Large size of ALBERT where all input is lowercased. "
107-
"Trained on English Wikipedia + BooksCorpus."
108-
),
109129
"weights_url": "https://storage.googleapis.com/keras-nlp/models/albert_extra_extra_large_en_uncased/v1/model.h5",
110130
"weights_hash": "a835177b692fb6a82139f94c66db2f22",
111131
"spm_proto_url": "https://storage.googleapis.com/keras-nlp/models/albert_extra_extra_large_en_uncased/v1/vocab.spm",

keras_nlp/models/bart/bart_presets.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@
2525
"max_sequence_length": 1024,
2626
},
2727
"preprocessor_config": {},
28-
"description": (
29-
"Base size of BART where case is maintained. "
30-
"Trained on a 160GB English dataset comprising BookCorpus, "
31-
"English Wikipedia and CommonCrawl."
32-
),
28+
"metadata": {
29+
"description": (
30+
"6-layer BART model where case is maintained. "
31+
"Trained on BookCorpus, English Wikipedia and CommonCrawl."
32+
),
33+
"params": 139417344,
34+
"official_name": "BART",
35+
"path": "bart",
36+
},
3337
"weights_url": "https://storage.googleapis.com/keras-nlp/models/bart_base_en/v1/model.h5",
3438
"weights_hash": "5b59403f0cafafbd89680e0785791163",
3539
"vocabulary_url": "https://storage.googleapis.com/keras-nlp/models/bart_base_en/v1/vocab.json",
@@ -48,11 +52,15 @@
4852
"max_sequence_length": 1024,
4953
},
5054
"preprocessor_config": {},
51-
"description": (
52-
"Large size of BART where case is maintained. "
53-
"Trained on a 160GB English dataset comprising BookCorpus, "
54-
"English Wikipedia and CommonCrawl."
55-
),
55+
"metadata": {
56+
"description": (
57+
"12-layer BART model where case is maintained. "
58+
"Trained on BookCorpus, English Wikipedia and CommonCrawl."
59+
),
60+
"params": 406287360,
61+
"official_name": "BART",
62+
"path": "bart",
63+
},
5664
"weights_url": "https://storage.googleapis.com/keras-nlp/models/bart_large_en/v1/model.h5",
5765
"weights_hash": "6bfe7e591af8c5699ce6f9f18753af9a",
5866
"vocabulary_url": "https://storage.googleapis.com/keras-nlp/models/bart_large_en/v1/vocab.json",

0 commit comments

Comments
 (0)