Upload folder using huggingface_hub
Browse files- .gitattributes +8 -0
- README.md +331 -0
- config.json +25 -0
- coreml/fill-mask/float32_model.mlpackage/Manifest.json +18 -0
- model.rknn +3 -0
- model_b1_s256.rknn +3 -0
- model_b4_s256.rknn +3 -0
- model_b4_s512.rknn +3 -0
- rknn.json +350 -0
- rknn/model_o1.rknn +3 -0
- rknn/model_o2.rknn +3 -0
- rknn/model_o3.rknn +3 -0
- rknn/model_w8a8.rknn +3 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +56 -0
- vocab.txt +0 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,11 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
model.rknn filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
model_b1_s256.rknn filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
model_b4_s256.rknn filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
model_b4_s512.rknn filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
rknn/model_o1.rknn filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
rknn/model_o2.rknn filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
rknn/model_o3.rknn filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
rknn/model_w8a8.rknn filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
| 8 |
+
- rk-transformers
|
| 9 |
+
- rk3588
|
| 10 |
+
license: apache-2.0
|
| 11 |
+
model_name: bert-base-uncased
|
| 12 |
+
base_model: google-bert/bert-base-uncased
|
| 13 |
+
library_name: rk-transformers
|
| 14 |
+
---
|
| 15 |
+
# bert-base-uncased (RKNN2)
|
| 16 |
+
|
| 17 |
+
> This is an RKNN-compatible version of the [google-bert/bert-base-uncased](https://huggingface.co/google-bert/bert-base-uncased) model. It has been optimized for Rockchip NPUs using the [rk-transformers](https://github.com/emapco/rk-transformers) library.
|
| 18 |
+
|
| 19 |
+
<details><summary>Click to see the RKNN model details and usage examples</summary>
|
| 20 |
+
|
| 21 |
+
## Model Details
|
| 22 |
+
|
| 23 |
+
- **Original Model:** [google-bert/bert-base-uncased](https://huggingface.co/google-bert/bert-base-uncased)
|
| 24 |
+
- **Target Platform:** rk3588
|
| 25 |
+
- **rknn-toolkit2 Version:** 2.3.2
|
| 26 |
+
- **rk-transformers Version:** 0.1.0
|
| 27 |
+
|
| 28 |
+
### Available Model Files
|
| 29 |
+
|
| 30 |
+
| Model File | Optimization Level | Quantization | File Size |
|
| 31 |
+
| :--------- | :----------------- | :----------- | :-------- |
|
| 32 |
+
| [model.rknn](./model.rknn) | 0 | float16 | 261.1 MB |
|
| 33 |
+
| [model_b1_s256.rknn](./model_b1_s256.rknn) | 0 | float16 | 258.4 MB |
|
| 34 |
+
| [model_b4_s256.rknn](./model_b4_s256.rknn) | 0 | float16 | 270.3 MB |
|
| 35 |
+
| [model_b4_s512.rknn](./model_b4_s512.rknn) | 0 | float16 | 280.5 MB |
|
| 36 |
+
| [rknn/model_o1.rknn](./rknn/model_o1.rknn) | 1 | float16 | 261.1 MB |
|
| 37 |
+
| [rknn/model_o2.rknn](./rknn/model_o2.rknn) | 2 | float16 | 261.1 MB |
|
| 38 |
+
| [rknn/model_o3.rknn](./rknn/model_o3.rknn) | 3 | float16 | 261.1 MB |
|
| 39 |
+
| [rknn/model_w8a8.rknn](./rknn/model_w8a8.rknn) | 0 | w8a8 | 133.6 MB |
|
| 40 |
+
|
| 41 |
+
## Usage
|
| 42 |
+
|
| 43 |
+
### Installation
|
| 44 |
+
|
| 45 |
+
Install `rk-transformers` to use this model:
|
| 46 |
+
|
| 47 |
+
```bash
|
| 48 |
+
pip install rk-transformers
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
#### RKTransformers API
|
| 52 |
+
|
| 53 |
+
```python
|
| 54 |
+
from rktransformers import RKRTModelForFeatureExtraction
|
| 55 |
+
from transformers import AutoTokenizer
|
| 56 |
+
|
| 57 |
+
# Load tokenizer and model
|
| 58 |
+
tokenizer = AutoTokenizer.from_pretrained("rk-transformers/bert-base-uncased")
|
| 59 |
+
model = RKRTModelForFeatureExtraction.from_pretrained(
|
| 60 |
+
"rk-transformers/bert-base-uncased",
|
| 61 |
+
platform="rk3588",
|
| 62 |
+
core_mask="auto",
|
| 63 |
+
)
|
| 64 |
+
|
| 65 |
+
# Tokenize and run inference
|
| 66 |
+
inputs = tokenizer(
|
| 67 |
+
["Sample text for encoding"],
|
| 68 |
+
padding="max_length",
|
| 69 |
+
max_length=256,
|
| 70 |
+
truncation=True,
|
| 71 |
+
return_tensors="np"
|
| 72 |
+
)
|
| 73 |
+
|
| 74 |
+
outputs = model(**inputs)
|
| 75 |
+
print(outputs.shape)
|
| 76 |
+
|
| 77 |
+
# Load specific optimized/quantized model file
|
| 78 |
+
model = RKRTModelForFeatureExtraction.from_pretrained(
|
| 79 |
+
"rk-transformers/bert-base-uncased",
|
| 80 |
+
platform="rk3588",
|
| 81 |
+
file_name="rknn/model_w8a8.rknn"
|
| 82 |
+
)
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
## Configuration
|
| 86 |
+
|
| 87 |
+
The full configuration for all exported RKNN models is available in the [rknn.json](./rknn.json) file.
|
| 88 |
+
|
| 89 |
+
</details>
|
| 90 |
+
|
| 91 |
+
# BERT base model (uncased)
|
| 92 |
+
|
| 93 |
+
Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in
|
| 94 |
+
[this paper](https://arxiv.org/abs/1810.04805) and first released in
|
| 95 |
+
[this repository](https://github.com/google-research/bert). This model is uncased: it does not make a difference
|
| 96 |
+
between english and English.
|
| 97 |
+
|
| 98 |
+
Disclaimer: The team releasing BERT did not write a model card for this model so this model card has been written by
|
| 99 |
+
the Hugging Face team.
|
| 100 |
+
|
| 101 |
+
## Model description
|
| 102 |
+
|
| 103 |
+
BERT is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means it
|
| 104 |
+
was pretrained on the raw texts only, with no humans labeling them in any way (which is why it can use lots of
|
| 105 |
+
publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely, it
|
| 106 |
+
was pretrained with two objectives:
|
| 107 |
+
|
| 108 |
+
- Masked language modeling (MLM): taking a sentence, the model randomly masks 15% of the words in the input then run
|
| 109 |
+
the entire masked sentence through the model and has to predict the masked words. This is different from traditional
|
| 110 |
+
recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like
|
| 111 |
+
GPT which internally masks the future tokens. It allows the model to learn a bidirectional representation of the
|
| 112 |
+
sentence.
|
| 113 |
+
- Next sentence prediction (NSP): the models concatenates two masked sentences as inputs during pretraining. Sometimes
|
| 114 |
+
they correspond to sentences that were next to each other in the original text, sometimes not. The model then has to
|
| 115 |
+
predict if the two sentences were following each other or not.
|
| 116 |
+
|
| 117 |
+
This way, the model learns an inner representation of the English language that can then be used to extract features
|
| 118 |
+
useful for downstream tasks: if you have a dataset of labeled sentences, for instance, you can train a standard
|
| 119 |
+
classifier using the features produced by the BERT model as inputs.
|
| 120 |
+
|
| 121 |
+
## Model variations
|
| 122 |
+
|
| 123 |
+
BERT has originally been released in base and large variations, for cased and uncased input text. The uncased models also strips out an accent markers.
|
| 124 |
+
Chinese and multilingual uncased and cased versions followed shortly after.
|
| 125 |
+
Modified preprocessing with whole word masking has replaced subpiece masking in a following work, with the release of two models.
|
| 126 |
+
Other 24 smaller models are released afterward.
|
| 127 |
+
|
| 128 |
+
The detailed release history can be found on the [google-research/bert readme](https://github.com/google-research/bert/blob/master/README.md) on github.
|
| 129 |
+
|
| 130 |
+
| Model | #params | Language |
|
| 131 |
+
|------------------------|--------------------------------|-------|
|
| 132 |
+
| [`bert-base-uncased`](https://huggingface.co/bert-base-uncased) | 110M | English |
|
| 133 |
+
| [`bert-large-uncased`](https://huggingface.co/bert-large-uncased) | 340M | English | sub
|
| 134 |
+
| [`bert-base-cased`](https://huggingface.co/bert-base-cased) | 110M | English |
|
| 135 |
+
| [`bert-large-cased`](https://huggingface.co/bert-large-cased) | 340M | English |
|
| 136 |
+
| [`bert-base-chinese`](https://huggingface.co/bert-base-chinese) | 110M | Chinese |
|
| 137 |
+
| [`bert-base-multilingual-cased`](https://huggingface.co/bert-base-multilingual-cased) | 110M | Multiple |
|
| 138 |
+
| [`bert-large-uncased-whole-word-masking`](https://huggingface.co/bert-large-uncased-whole-word-masking) | 340M | English |
|
| 139 |
+
| [`bert-large-cased-whole-word-masking`](https://huggingface.co/bert-large-cased-whole-word-masking) | 340M | English |
|
| 140 |
+
|
| 141 |
+
## Intended uses & limitations
|
| 142 |
+
|
| 143 |
+
You can use the raw model for either masked language modeling or next sentence prediction, but it's mostly intended to
|
| 144 |
+
be fine-tuned on a downstream task. See the [model hub](https://huggingface.co/models?filter=bert) to look for
|
| 145 |
+
fine-tuned versions of a task that interests you.
|
| 146 |
+
|
| 147 |
+
Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked)
|
| 148 |
+
to make decisions, such as sequence classification, token classification or question answering. For tasks such as text
|
| 149 |
+
generation you should look at model like GPT2.
|
| 150 |
+
|
| 151 |
+
### How to use
|
| 152 |
+
|
| 153 |
+
You can use this model directly with a pipeline for masked language modeling:
|
| 154 |
+
|
| 155 |
+
```python
|
| 156 |
+
>>> from transformers import pipeline
|
| 157 |
+
>>> unmasker = pipeline('fill-mask', model='bert-base-uncased')
|
| 158 |
+
>>> unmasker("Hello I'm a [MASK] model.")
|
| 159 |
+
|
| 160 |
+
[{'sequence': "[CLS] hello i'm a fashion model. [SEP]",
|
| 161 |
+
'score': 0.1073106899857521,
|
| 162 |
+
'token': 4827,
|
| 163 |
+
'token_str': 'fashion'},
|
| 164 |
+
{'sequence': "[CLS] hello i'm a role model. [SEP]",
|
| 165 |
+
'score': 0.08774490654468536,
|
| 166 |
+
'token': 2535,
|
| 167 |
+
'token_str': 'role'},
|
| 168 |
+
{'sequence': "[CLS] hello i'm a new model. [SEP]",
|
| 169 |
+
'score': 0.05338378623127937,
|
| 170 |
+
'token': 2047,
|
| 171 |
+
'token_str': 'new'},
|
| 172 |
+
{'sequence': "[CLS] hello i'm a super model. [SEP]",
|
| 173 |
+
'score': 0.04667217284440994,
|
| 174 |
+
'token': 3565,
|
| 175 |
+
'token_str': 'super'},
|
| 176 |
+
{'sequence': "[CLS] hello i'm a fine model. [SEP]",
|
| 177 |
+
'score': 0.027095865458250046,
|
| 178 |
+
'token': 2986,
|
| 179 |
+
'token_str': 'fine'}]
|
| 180 |
+
```
|
| 181 |
+
|
| 182 |
+
Here is how to use this model to get the features of a given text in PyTorch:
|
| 183 |
+
|
| 184 |
+
```python
|
| 185 |
+
from transformers import BertTokenizer, BertModel
|
| 186 |
+
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
|
| 187 |
+
model = BertModel.from_pretrained("bert-base-uncased")
|
| 188 |
+
text = "Replace me by any text you'd like."
|
| 189 |
+
encoded_input = tokenizer(text, return_tensors='pt')
|
| 190 |
+
output = model(**encoded_input)
|
| 191 |
+
```
|
| 192 |
+
|
| 193 |
+
and in TensorFlow:
|
| 194 |
+
|
| 195 |
+
```python
|
| 196 |
+
from transformers import BertTokenizer, TFBertModel
|
| 197 |
+
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
|
| 198 |
+
model = TFBertModel.from_pretrained("bert-base-uncased")
|
| 199 |
+
text = "Replace me by any text you'd like."
|
| 200 |
+
encoded_input = tokenizer(text, return_tensors='tf')
|
| 201 |
+
output = model(encoded_input)
|
| 202 |
+
```
|
| 203 |
+
|
| 204 |
+
### Limitations and bias
|
| 205 |
+
|
| 206 |
+
Even if the training data used for this model could be characterized as fairly neutral, this model can have biased
|
| 207 |
+
predictions:
|
| 208 |
+
|
| 209 |
+
```python
|
| 210 |
+
>>> from transformers import pipeline
|
| 211 |
+
>>> unmasker = pipeline('fill-mask', model='bert-base-uncased')
|
| 212 |
+
>>> unmasker("The man worked as a [MASK].")
|
| 213 |
+
|
| 214 |
+
[{'sequence': '[CLS] the man worked as a carpenter. [SEP]',
|
| 215 |
+
'score': 0.09747550636529922,
|
| 216 |
+
'token': 10533,
|
| 217 |
+
'token_str': 'carpenter'},
|
| 218 |
+
{'sequence': '[CLS] the man worked as a waiter. [SEP]',
|
| 219 |
+
'score': 0.0523831807076931,
|
| 220 |
+
'token': 15610,
|
| 221 |
+
'token_str': 'waiter'},
|
| 222 |
+
{'sequence': '[CLS] the man worked as a barber. [SEP]',
|
| 223 |
+
'score': 0.04962705448269844,
|
| 224 |
+
'token': 13362,
|
| 225 |
+
'token_str': 'barber'},
|
| 226 |
+
{'sequence': '[CLS] the man worked as a mechanic. [SEP]',
|
| 227 |
+
'score': 0.03788609802722931,
|
| 228 |
+
'token': 15893,
|
| 229 |
+
'token_str': 'mechanic'},
|
| 230 |
+
{'sequence': '[CLS] the man worked as a salesman. [SEP]',
|
| 231 |
+
'score': 0.037680890411138535,
|
| 232 |
+
'token': 18968,
|
| 233 |
+
'token_str': 'salesman'}]
|
| 234 |
+
|
| 235 |
+
>>> unmasker("The woman worked as a [MASK].")
|
| 236 |
+
|
| 237 |
+
[{'sequence': '[CLS] the woman worked as a nurse. [SEP]',
|
| 238 |
+
'score': 0.21981462836265564,
|
| 239 |
+
'token': 6821,
|
| 240 |
+
'token_str': 'nurse'},
|
| 241 |
+
{'sequence': '[CLS] the woman worked as a waitress. [SEP]',
|
| 242 |
+
'score': 0.1597415804862976,
|
| 243 |
+
'token': 13877,
|
| 244 |
+
'token_str': 'waitress'},
|
| 245 |
+
{'sequence': '[CLS] the woman worked as a maid. [SEP]',
|
| 246 |
+
'score': 0.1154729500412941,
|
| 247 |
+
'token': 10850,
|
| 248 |
+
'token_str': 'maid'},
|
| 249 |
+
{'sequence': '[CLS] the woman worked as a prostitute. [SEP]',
|
| 250 |
+
'score': 0.037968918681144714,
|
| 251 |
+
'token': 19215,
|
| 252 |
+
'token_str': 'prostitute'},
|
| 253 |
+
{'sequence': '[CLS] the woman worked as a cook. [SEP]',
|
| 254 |
+
'score': 0.03042375110089779,
|
| 255 |
+
'token': 5660,
|
| 256 |
+
'token_str': 'cook'}]
|
| 257 |
+
```
|
| 258 |
+
|
| 259 |
+
This bias will also affect all fine-tuned versions of this model.
|
| 260 |
+
|
| 261 |
+
## Training data
|
| 262 |
+
|
| 263 |
+
The BERT model was pretrained on [BookCorpus](https://yknzhu.wixsite.com/mbweb), a dataset consisting of 11,038
|
| 264 |
+
unpublished books and [English Wikipedia](https://en.wikipedia.org/wiki/English_Wikipedia) (excluding lists, tables and
|
| 265 |
+
headers).
|
| 266 |
+
|
| 267 |
+
## Training procedure
|
| 268 |
+
|
| 269 |
+
### Preprocessing
|
| 270 |
+
|
| 271 |
+
The texts are lowercased and tokenized using WordPiece and a vocabulary size of 30,000. The inputs of the model are
|
| 272 |
+
then of the form:
|
| 273 |
+
|
| 274 |
+
```
|
| 275 |
+
[CLS] Sentence A [SEP] Sentence B [SEP]
|
| 276 |
+
```
|
| 277 |
+
|
| 278 |
+
With probability 0.5, sentence A and sentence B correspond to two consecutive sentences in the original corpus, and in
|
| 279 |
+
the other cases, it's another random sentence in the corpus. Note that what is considered a sentence here is a
|
| 280 |
+
consecutive span of text usually longer than a single sentence. The only constrain is that the result with the two
|
| 281 |
+
"sentences" has a combined length of less than 512 tokens.
|
| 282 |
+
|
| 283 |
+
The details of the masking procedure for each sentence are the following:
|
| 284 |
+
- 15% of the tokens are masked.
|
| 285 |
+
- In 80% of the cases, the masked tokens are replaced by `[MASK]`.
|
| 286 |
+
- In 10% of the cases, the masked tokens are replaced by a random token (different) from the one they replace.
|
| 287 |
+
- In the 10% remaining cases, the masked tokens are left as is.
|
| 288 |
+
|
| 289 |
+
### Pretraining
|
| 290 |
+
|
| 291 |
+
The model was trained on 4 cloud TPUs in Pod configuration (16 TPU chips total) for one million steps with a batch size
|
| 292 |
+
of 256. The sequence length was limited to 128 tokens for 90% of the steps and 512 for the remaining 10%. The optimizer
|
| 293 |
+
used is Adam with a learning rate of 1e-4, \\(\beta_{1} = 0.9\\) and \\(\beta_{2} = 0.999\\), a weight decay of 0.01,
|
| 294 |
+
learning rate warmup for 10,000 steps and linear decay of the learning rate after.
|
| 295 |
+
|
| 296 |
+
## Evaluation results
|
| 297 |
+
|
| 298 |
+
When fine-tuned on downstream tasks, this model achieves the following results:
|
| 299 |
+
|
| 300 |
+
Glue test results:
|
| 301 |
+
|
| 302 |
+
| Task | MNLI-(m/mm) | QQP | QNLI | SST-2 | CoLA | STS-B | MRPC | RTE | Average |
|
| 303 |
+
|:----:|:-----------:|:----:|:----:|:-----:|:----:|:-----:|:----:|:----:|:-------:|
|
| 304 |
+
| | 84.6/83.4 | 71.2 | 90.5 | 93.5 | 52.1 | 85.8 | 88.9 | 66.4 | 79.6 |
|
| 305 |
+
|
| 306 |
+
|
| 307 |
+
### BibTeX entry and citation info
|
| 308 |
+
|
| 309 |
+
```bibtex
|
| 310 |
+
@article{DBLP:journals/corr/abs-1810-04805,
|
| 311 |
+
author = {Jacob Devlin and
|
| 312 |
+
Ming{-}Wei Chang and
|
| 313 |
+
Kenton Lee and
|
| 314 |
+
Kristina Toutanova},
|
| 315 |
+
title = {{BERT:} Pre-training of Deep Bidirectional Transformers for Language
|
| 316 |
+
Understanding},
|
| 317 |
+
journal = {CoRR},
|
| 318 |
+
volume = {abs/1810.04805},
|
| 319 |
+
year = {2018},
|
| 320 |
+
url = {http://arxiv.org/abs/1810.04805},
|
| 321 |
+
archivePrefix = {arXiv},
|
| 322 |
+
eprint = {1810.04805},
|
| 323 |
+
timestamp = {Tue, 30 Oct 2018 20:39:56 +0100},
|
| 324 |
+
biburl = {https://dblp.org/rec/journals/corr/abs-1810-04805.bib},
|
| 325 |
+
bibsource = {dblp computer science bibliography, https://dblp.org}
|
| 326 |
+
}
|
| 327 |
+
```
|
| 328 |
+
|
| 329 |
+
<a href="https://huggingface.co/exbert/?model=bert-base-uncased">
|
| 330 |
+
<img width="300px" src="https://cdn-media.huggingface.co/exbert/button.png">
|
| 331 |
+
</a>
|
config.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"BertForMaskedLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_probs_dropout_prob": 0.1,
|
| 6 |
+
"classifier_dropout": null,
|
| 7 |
+
"gradient_checkpointing": false,
|
| 8 |
+
"hidden_act": "gelu",
|
| 9 |
+
"hidden_dropout_prob": 0.1,
|
| 10 |
+
"hidden_size": 768,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 3072,
|
| 13 |
+
"layer_norm_eps": 1e-12,
|
| 14 |
+
"max_position_embeddings": 512,
|
| 15 |
+
"model_type": "bert",
|
| 16 |
+
"num_attention_heads": 12,
|
| 17 |
+
"num_hidden_layers": 12,
|
| 18 |
+
"pad_token_id": 0,
|
| 19 |
+
"position_embedding_type": "absolute",
|
| 20 |
+
"torch_dtype": "float32",
|
| 21 |
+
"transformers_version": "4.55.4",
|
| 22 |
+
"type_vocab_size": 2,
|
| 23 |
+
"use_cache": true,
|
| 24 |
+
"vocab_size": 30522
|
| 25 |
+
}
|
coreml/fill-mask/float32_model.mlpackage/Manifest.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"fileFormatVersion": "1.0.0",
|
| 3 |
+
"itemInfoEntries": {
|
| 4 |
+
"9D749A46-ADA0-43CA-B5C2-8E722B91F41E": {
|
| 5 |
+
"author": "com.apple.CoreML",
|
| 6 |
+
"description": "CoreML Model Specification",
|
| 7 |
+
"name": "model.mlmodel",
|
| 8 |
+
"path": "com.apple.CoreML/model.mlmodel"
|
| 9 |
+
},
|
| 10 |
+
"D545B13F-2D5E-4CFB-BFF1-C10E9EFD70DA": {
|
| 11 |
+
"author": "com.apple.CoreML",
|
| 12 |
+
"description": "CoreML Model Weights",
|
| 13 |
+
"name": "weights",
|
| 14 |
+
"path": "com.apple.CoreML/weights"
|
| 15 |
+
}
|
| 16 |
+
},
|
| 17 |
+
"rootModelIdentifier": "9D749A46-ADA0-43CA-B5C2-8E722B91F41E"
|
| 18 |
+
}
|
model.rknn
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b82e76cd0d3c4bb14ba88aa6a0e2843f2e904cb65ca955ba5f465f0b5c9304d7
|
| 3 |
+
size 273830854
|
model_b1_s256.rknn
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a5c3d5aa68001fd22f0f66cda6c8e04cbdad931a430d5d0802e8bed325d72d36
|
| 3 |
+
size 270969670
|
model_b4_s256.rknn
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:abad409b4f884e6a49c4d1a2144dd90f5a70ec9a615014da2fc62747fb755457
|
| 3 |
+
size 283424646
|
model_b4_s512.rknn
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0c777bf44463b5738af0693ce5a5fe54cf4f4516c6bff68e7979f89d8c11ee80
|
| 3 |
+
size 294075782
|
rknn.json
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model.rknn": {
|
| 3 |
+
"model_input_names": [
|
| 4 |
+
"input_ids",
|
| 5 |
+
"attention_mask",
|
| 6 |
+
"token_type_ids"
|
| 7 |
+
],
|
| 8 |
+
"batch_size": 1,
|
| 9 |
+
"max_seq_length": 512,
|
| 10 |
+
"float_dtype": "float16",
|
| 11 |
+
"target_platform": "rk3588",
|
| 12 |
+
"single_core_mode": false,
|
| 13 |
+
"mean_values": null,
|
| 14 |
+
"std_values": null,
|
| 15 |
+
"custom_string": null,
|
| 16 |
+
"inputs_yuv_fmt": null,
|
| 17 |
+
"dynamic_input": null,
|
| 18 |
+
"opset": 18,
|
| 19 |
+
"task": "fill-mask",
|
| 20 |
+
"quantization": {
|
| 21 |
+
"do_quantization": false,
|
| 22 |
+
"dataset_name": null,
|
| 23 |
+
"dataset_subset": null,
|
| 24 |
+
"dataset_size": 128,
|
| 25 |
+
"dataset_split": null,
|
| 26 |
+
"dataset_columns": null,
|
| 27 |
+
"quantized_dtype": "w8a8",
|
| 28 |
+
"quantized_algorithm": "normal",
|
| 29 |
+
"quantized_method": "channel",
|
| 30 |
+
"quantized_hybrid_level": 0,
|
| 31 |
+
"quant_img_RGB2BGR": false,
|
| 32 |
+
"auto_hybrid_cos_thresh": 0.98,
|
| 33 |
+
"auto_hybrid_euc_thresh": null
|
| 34 |
+
},
|
| 35 |
+
"optimization": {
|
| 36 |
+
"optimization_level": 0,
|
| 37 |
+
"enable_flash_attention": true,
|
| 38 |
+
"remove_weight": false,
|
| 39 |
+
"compress_weight": false,
|
| 40 |
+
"remove_reshape": false,
|
| 41 |
+
"sparse_infer": false,
|
| 42 |
+
"model_pruning": false
|
| 43 |
+
}
|
| 44 |
+
},
|
| 45 |
+
"rknn/model_o1.rknn": {
|
| 46 |
+
"model_input_names": [
|
| 47 |
+
"input_ids",
|
| 48 |
+
"attention_mask",
|
| 49 |
+
"token_type_ids"
|
| 50 |
+
],
|
| 51 |
+
"batch_size": 1,
|
| 52 |
+
"max_seq_length": 512,
|
| 53 |
+
"float_dtype": "float16",
|
| 54 |
+
"target_platform": "rk3588",
|
| 55 |
+
"single_core_mode": false,
|
| 56 |
+
"mean_values": null,
|
| 57 |
+
"std_values": null,
|
| 58 |
+
"custom_string": null,
|
| 59 |
+
"inputs_yuv_fmt": null,
|
| 60 |
+
"dynamic_input": null,
|
| 61 |
+
"opset": 18,
|
| 62 |
+
"task": "fill-mask",
|
| 63 |
+
"quantization": {
|
| 64 |
+
"do_quantization": false,
|
| 65 |
+
"dataset_name": null,
|
| 66 |
+
"dataset_subset": null,
|
| 67 |
+
"dataset_size": 128,
|
| 68 |
+
"dataset_split": null,
|
| 69 |
+
"dataset_columns": null,
|
| 70 |
+
"quantized_dtype": "w8a8",
|
| 71 |
+
"quantized_algorithm": "normal",
|
| 72 |
+
"quantized_method": "channel",
|
| 73 |
+
"quantized_hybrid_level": 0,
|
| 74 |
+
"quant_img_RGB2BGR": false,
|
| 75 |
+
"auto_hybrid_cos_thresh": 0.98,
|
| 76 |
+
"auto_hybrid_euc_thresh": null
|
| 77 |
+
},
|
| 78 |
+
"optimization": {
|
| 79 |
+
"optimization_level": 1,
|
| 80 |
+
"enable_flash_attention": true,
|
| 81 |
+
"remove_weight": false,
|
| 82 |
+
"compress_weight": false,
|
| 83 |
+
"remove_reshape": false,
|
| 84 |
+
"sparse_infer": false,
|
| 85 |
+
"model_pruning": false
|
| 86 |
+
}
|
| 87 |
+
},
|
| 88 |
+
"rknn/model_o2.rknn": {
|
| 89 |
+
"model_input_names": [
|
| 90 |
+
"input_ids",
|
| 91 |
+
"attention_mask",
|
| 92 |
+
"token_type_ids"
|
| 93 |
+
],
|
| 94 |
+
"batch_size": 1,
|
| 95 |
+
"max_seq_length": 512,
|
| 96 |
+
"float_dtype": "float16",
|
| 97 |
+
"target_platform": "rk3588",
|
| 98 |
+
"single_core_mode": false,
|
| 99 |
+
"mean_values": null,
|
| 100 |
+
"std_values": null,
|
| 101 |
+
"custom_string": null,
|
| 102 |
+
"inputs_yuv_fmt": null,
|
| 103 |
+
"dynamic_input": null,
|
| 104 |
+
"opset": 18,
|
| 105 |
+
"task": "fill-mask",
|
| 106 |
+
"quantization": {
|
| 107 |
+
"do_quantization": false,
|
| 108 |
+
"dataset_name": null,
|
| 109 |
+
"dataset_subset": null,
|
| 110 |
+
"dataset_size": 128,
|
| 111 |
+
"dataset_split": null,
|
| 112 |
+
"dataset_columns": null,
|
| 113 |
+
"quantized_dtype": "w8a8",
|
| 114 |
+
"quantized_algorithm": "normal",
|
| 115 |
+
"quantized_method": "channel",
|
| 116 |
+
"quantized_hybrid_level": 0,
|
| 117 |
+
"quant_img_RGB2BGR": false,
|
| 118 |
+
"auto_hybrid_cos_thresh": 0.98,
|
| 119 |
+
"auto_hybrid_euc_thresh": null
|
| 120 |
+
},
|
| 121 |
+
"optimization": {
|
| 122 |
+
"optimization_level": 2,
|
| 123 |
+
"enable_flash_attention": true,
|
| 124 |
+
"remove_weight": false,
|
| 125 |
+
"compress_weight": false,
|
| 126 |
+
"remove_reshape": false,
|
| 127 |
+
"sparse_infer": false,
|
| 128 |
+
"model_pruning": false
|
| 129 |
+
}
|
| 130 |
+
},
|
| 131 |
+
"rknn/model_o3.rknn": {
|
| 132 |
+
"model_input_names": [
|
| 133 |
+
"input_ids",
|
| 134 |
+
"attention_mask",
|
| 135 |
+
"token_type_ids"
|
| 136 |
+
],
|
| 137 |
+
"batch_size": 1,
|
| 138 |
+
"max_seq_length": 512,
|
| 139 |
+
"float_dtype": "float16",
|
| 140 |
+
"target_platform": "rk3588",
|
| 141 |
+
"single_core_mode": false,
|
| 142 |
+
"mean_values": null,
|
| 143 |
+
"std_values": null,
|
| 144 |
+
"custom_string": null,
|
| 145 |
+
"inputs_yuv_fmt": null,
|
| 146 |
+
"dynamic_input": null,
|
| 147 |
+
"opset": 18,
|
| 148 |
+
"task": "fill-mask",
|
| 149 |
+
"quantization": {
|
| 150 |
+
"do_quantization": false,
|
| 151 |
+
"dataset_name": null,
|
| 152 |
+
"dataset_subset": null,
|
| 153 |
+
"dataset_size": 128,
|
| 154 |
+
"dataset_split": null,
|
| 155 |
+
"dataset_columns": null,
|
| 156 |
+
"quantized_dtype": "w8a8",
|
| 157 |
+
"quantized_algorithm": "normal",
|
| 158 |
+
"quantized_method": "channel",
|
| 159 |
+
"quantized_hybrid_level": 0,
|
| 160 |
+
"quant_img_RGB2BGR": false,
|
| 161 |
+
"auto_hybrid_cos_thresh": 0.98,
|
| 162 |
+
"auto_hybrid_euc_thresh": null
|
| 163 |
+
},
|
| 164 |
+
"optimization": {
|
| 165 |
+
"optimization_level": 3,
|
| 166 |
+
"enable_flash_attention": true,
|
| 167 |
+
"remove_weight": false,
|
| 168 |
+
"compress_weight": false,
|
| 169 |
+
"remove_reshape": false,
|
| 170 |
+
"sparse_infer": false,
|
| 171 |
+
"model_pruning": false
|
| 172 |
+
}
|
| 173 |
+
},
|
| 174 |
+
"rknn/model_w8a8.rknn": {
|
| 175 |
+
"model_input_names": [
|
| 176 |
+
"input_ids",
|
| 177 |
+
"attention_mask",
|
| 178 |
+
"token_type_ids"
|
| 179 |
+
],
|
| 180 |
+
"batch_size": 1,
|
| 181 |
+
"max_seq_length": 512,
|
| 182 |
+
"float_dtype": "float16",
|
| 183 |
+
"target_platform": "rk3588",
|
| 184 |
+
"single_core_mode": false,
|
| 185 |
+
"mean_values": null,
|
| 186 |
+
"std_values": null,
|
| 187 |
+
"custom_string": null,
|
| 188 |
+
"inputs_yuv_fmt": null,
|
| 189 |
+
"dynamic_input": null,
|
| 190 |
+
"opset": 18,
|
| 191 |
+
"task": "fill-mask",
|
| 192 |
+
"quantization": {
|
| 193 |
+
"do_quantization": true,
|
| 194 |
+
"dataset_name": "sentence-transformers/natural-questions",
|
| 195 |
+
"dataset_subset": null,
|
| 196 |
+
"dataset_size": 2048,
|
| 197 |
+
"dataset_split": [
|
| 198 |
+
"train"
|
| 199 |
+
],
|
| 200 |
+
"dataset_columns": [
|
| 201 |
+
"answer"
|
| 202 |
+
],
|
| 203 |
+
"quantized_dtype": "w8a8",
|
| 204 |
+
"quantized_algorithm": "normal",
|
| 205 |
+
"quantized_method": "channel",
|
| 206 |
+
"quantized_hybrid_level": 0,
|
| 207 |
+
"quant_img_RGB2BGR": false,
|
| 208 |
+
"auto_hybrid_cos_thresh": 0.98,
|
| 209 |
+
"auto_hybrid_euc_thresh": null
|
| 210 |
+
},
|
| 211 |
+
"optimization": {
|
| 212 |
+
"optimization_level": 0,
|
| 213 |
+
"enable_flash_attention": true,
|
| 214 |
+
"remove_weight": false,
|
| 215 |
+
"compress_weight": false,
|
| 216 |
+
"remove_reshape": false,
|
| 217 |
+
"sparse_infer": false,
|
| 218 |
+
"model_pruning": false
|
| 219 |
+
}
|
| 220 |
+
},
|
| 221 |
+
"model_b4_s512.rknn": {
|
| 222 |
+
"model_input_names": [
|
| 223 |
+
"input_ids",
|
| 224 |
+
"attention_mask",
|
| 225 |
+
"token_type_ids"
|
| 226 |
+
],
|
| 227 |
+
"batch_size": 4,
|
| 228 |
+
"max_seq_length": 512,
|
| 229 |
+
"float_dtype": "float16",
|
| 230 |
+
"target_platform": "rk3588",
|
| 231 |
+
"single_core_mode": false,
|
| 232 |
+
"mean_values": null,
|
| 233 |
+
"std_values": null,
|
| 234 |
+
"custom_string": null,
|
| 235 |
+
"inputs_yuv_fmt": null,
|
| 236 |
+
"dynamic_input": null,
|
| 237 |
+
"opset": 18,
|
| 238 |
+
"task": "fill-mask",
|
| 239 |
+
"quantization": {
|
| 240 |
+
"do_quantization": false,
|
| 241 |
+
"dataset_name": null,
|
| 242 |
+
"dataset_subset": null,
|
| 243 |
+
"dataset_size": 128,
|
| 244 |
+
"dataset_split": null,
|
| 245 |
+
"dataset_columns": null,
|
| 246 |
+
"quantized_dtype": "w8a8",
|
| 247 |
+
"quantized_algorithm": "normal",
|
| 248 |
+
"quantized_method": "channel",
|
| 249 |
+
"quantized_hybrid_level": 0,
|
| 250 |
+
"quant_img_RGB2BGR": false,
|
| 251 |
+
"auto_hybrid_cos_thresh": 0.98,
|
| 252 |
+
"auto_hybrid_euc_thresh": null
|
| 253 |
+
},
|
| 254 |
+
"optimization": {
|
| 255 |
+
"optimization_level": 0,
|
| 256 |
+
"enable_flash_attention": true,
|
| 257 |
+
"remove_weight": false,
|
| 258 |
+
"compress_weight": false,
|
| 259 |
+
"remove_reshape": false,
|
| 260 |
+
"sparse_infer": false,
|
| 261 |
+
"model_pruning": false
|
| 262 |
+
}
|
| 263 |
+
},
|
| 264 |
+
"model_b1_s256.rknn": {
|
| 265 |
+
"model_input_names": [
|
| 266 |
+
"input_ids",
|
| 267 |
+
"attention_mask",
|
| 268 |
+
"token_type_ids"
|
| 269 |
+
],
|
| 270 |
+
"batch_size": 1,
|
| 271 |
+
"max_seq_length": 256,
|
| 272 |
+
"float_dtype": "float16",
|
| 273 |
+
"target_platform": "rk3588",
|
| 274 |
+
"single_core_mode": false,
|
| 275 |
+
"mean_values": null,
|
| 276 |
+
"std_values": null,
|
| 277 |
+
"custom_string": null,
|
| 278 |
+
"inputs_yuv_fmt": null,
|
| 279 |
+
"dynamic_input": null,
|
| 280 |
+
"opset": 18,
|
| 281 |
+
"task": "auto",
|
| 282 |
+
"quantization": {
|
| 283 |
+
"do_quantization": false,
|
| 284 |
+
"dataset_name": null,
|
| 285 |
+
"dataset_subset": null,
|
| 286 |
+
"dataset_size": 128,
|
| 287 |
+
"dataset_split": null,
|
| 288 |
+
"dataset_columns": null,
|
| 289 |
+
"quantized_dtype": "w8a8",
|
| 290 |
+
"quantized_algorithm": "normal",
|
| 291 |
+
"quantized_method": "channel",
|
| 292 |
+
"quantized_hybrid_level": 0,
|
| 293 |
+
"quant_img_RGB2BGR": false,
|
| 294 |
+
"auto_hybrid_cos_thresh": 0.98,
|
| 295 |
+
"auto_hybrid_euc_thresh": null
|
| 296 |
+
},
|
| 297 |
+
"optimization": {
|
| 298 |
+
"optimization_level": 0,
|
| 299 |
+
"enable_flash_attention": true,
|
| 300 |
+
"remove_weight": false,
|
| 301 |
+
"compress_weight": false,
|
| 302 |
+
"remove_reshape": false,
|
| 303 |
+
"sparse_infer": false,
|
| 304 |
+
"model_pruning": false
|
| 305 |
+
}
|
| 306 |
+
},
|
| 307 |
+
"model_b4_s256.rknn": {
|
| 308 |
+
"model_input_names": [
|
| 309 |
+
"input_ids",
|
| 310 |
+
"attention_mask",
|
| 311 |
+
"token_type_ids"
|
| 312 |
+
],
|
| 313 |
+
"batch_size": 4,
|
| 314 |
+
"max_seq_length": 256,
|
| 315 |
+
"float_dtype": "float16",
|
| 316 |
+
"target_platform": "rk3588",
|
| 317 |
+
"single_core_mode": false,
|
| 318 |
+
"mean_values": null,
|
| 319 |
+
"std_values": null,
|
| 320 |
+
"custom_string": null,
|
| 321 |
+
"inputs_yuv_fmt": null,
|
| 322 |
+
"dynamic_input": null,
|
| 323 |
+
"opset": 18,
|
| 324 |
+
"task": "auto",
|
| 325 |
+
"quantization": {
|
| 326 |
+
"do_quantization": false,
|
| 327 |
+
"dataset_name": null,
|
| 328 |
+
"dataset_subset": null,
|
| 329 |
+
"dataset_size": 128,
|
| 330 |
+
"dataset_split": null,
|
| 331 |
+
"dataset_columns": null,
|
| 332 |
+
"quantized_dtype": "w8a8",
|
| 333 |
+
"quantized_algorithm": "normal",
|
| 334 |
+
"quantized_method": "channel",
|
| 335 |
+
"quantized_hybrid_level": 0,
|
| 336 |
+
"quant_img_RGB2BGR": false,
|
| 337 |
+
"auto_hybrid_cos_thresh": 0.98,
|
| 338 |
+
"auto_hybrid_euc_thresh": null
|
| 339 |
+
},
|
| 340 |
+
"optimization": {
|
| 341 |
+
"optimization_level": 0,
|
| 342 |
+
"enable_flash_attention": true,
|
| 343 |
+
"remove_weight": false,
|
| 344 |
+
"compress_weight": false,
|
| 345 |
+
"remove_reshape": false,
|
| 346 |
+
"sparse_infer": false,
|
| 347 |
+
"model_pruning": false
|
| 348 |
+
}
|
| 349 |
+
}
|
| 350 |
+
}
|
rknn/model_o1.rknn
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b82e76cd0d3c4bb14ba88aa6a0e2843f2e904cb65ca955ba5f465f0b5c9304d7
|
| 3 |
+
size 273830854
|
rknn/model_o2.rknn
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b82e76cd0d3c4bb14ba88aa6a0e2843f2e904cb65ca955ba5f465f0b5c9304d7
|
| 3 |
+
size 273830854
|
rknn/model_o3.rknn
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8436f148c0cc91d78ba562aac653601a3a69e7cc11d70922efa107437a750ebd
|
| 3 |
+
size 273830854
|
rknn/model_w8a8.rknn
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2b35b9cf8db6760f45b2fd9cc700e5bd88f8af73a69ecc87fe70799aa8ecd5b0
|
| 3 |
+
size 140070675
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cls_token": "[CLS]",
|
| 3 |
+
"mask_token": "[MASK]",
|
| 4 |
+
"pad_token": "[PAD]",
|
| 5 |
+
"sep_token": "[SEP]",
|
| 6 |
+
"unk_token": "[UNK]"
|
| 7 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "[PAD]",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"100": {
|
| 12 |
+
"content": "[UNK]",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"101": {
|
| 20 |
+
"content": "[CLS]",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"102": {
|
| 28 |
+
"content": "[SEP]",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"103": {
|
| 36 |
+
"content": "[MASK]",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
}
|
| 43 |
+
},
|
| 44 |
+
"clean_up_tokenization_spaces": false,
|
| 45 |
+
"cls_token": "[CLS]",
|
| 46 |
+
"do_lower_case": true,
|
| 47 |
+
"extra_special_tokens": {},
|
| 48 |
+
"mask_token": "[MASK]",
|
| 49 |
+
"model_max_length": 512,
|
| 50 |
+
"pad_token": "[PAD]",
|
| 51 |
+
"sep_token": "[SEP]",
|
| 52 |
+
"strip_accents": null,
|
| 53 |
+
"tokenize_chinese_chars": true,
|
| 54 |
+
"tokenizer_class": "BertTokenizer",
|
| 55 |
+
"unk_token": "[UNK]"
|
| 56 |
+
}
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|