Lolalb commited on
Commit
93e4e85
·
verified ·
1 Parent(s): c810eb2

Upload tokenizer

Browse files
Files changed (5) hide show
  1. README.md +199 -0
  2. special_tokens_map.json +7 -0
  3. tokenizer.json +103 -0
  4. tokenizer.py +304 -0
  5. tokenizer_config.json +71 -0
README.md ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ tags: []
4
+ ---
5
+
6
+ # Model Card for Model ID
7
+
8
+ <!-- Provide a quick summary of what the model is/does. -->
9
+
10
+
11
+
12
+ ## Model Details
13
+
14
+ ### Model Description
15
+
16
+ <!-- Provide a longer summary of what this model is. -->
17
+
18
+ This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
+
20
+ - **Developed by:** [More Information Needed]
21
+ - **Funded by [optional]:** [More Information Needed]
22
+ - **Shared by [optional]:** [More Information Needed]
23
+ - **Model type:** [More Information Needed]
24
+ - **Language(s) (NLP):** [More Information Needed]
25
+ - **License:** [More Information Needed]
26
+ - **Finetuned from model [optional]:** [More Information Needed]
27
+
28
+ ### Model Sources [optional]
29
+
30
+ <!-- Provide the basic links for the model. -->
31
+
32
+ - **Repository:** [More Information Needed]
33
+ - **Paper [optional]:** [More Information Needed]
34
+ - **Demo [optional]:** [More Information Needed]
35
+
36
+ ## Uses
37
+
38
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
+
40
+ ### Direct Use
41
+
42
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
+
44
+ [More Information Needed]
45
+
46
+ ### Downstream Use [optional]
47
+
48
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
+
50
+ [More Information Needed]
51
+
52
+ ### Out-of-Scope Use
53
+
54
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
+
56
+ [More Information Needed]
57
+
58
+ ## Bias, Risks, and Limitations
59
+
60
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
+
62
+ [More Information Needed]
63
+
64
+ ### Recommendations
65
+
66
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
+
68
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
+
70
+ ## How to Get Started with the Model
71
+
72
+ Use the code below to get started with the model.
73
+
74
+ [More Information Needed]
75
+
76
+ ## Training Details
77
+
78
+ ### Training Data
79
+
80
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
+
82
+ [More Information Needed]
83
+
84
+ ### Training Procedure
85
+
86
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
+
88
+ #### Preprocessing [optional]
89
+
90
+ [More Information Needed]
91
+
92
+
93
+ #### Training Hyperparameters
94
+
95
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
+
97
+ #### Speeds, Sizes, Times [optional]
98
+
99
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
+
101
+ [More Information Needed]
102
+
103
+ ## Evaluation
104
+
105
+ <!-- This section describes the evaluation protocols and provides the results. -->
106
+
107
+ ### Testing Data, Factors & Metrics
108
+
109
+ #### Testing Data
110
+
111
+ <!-- This should link to a Dataset Card if possible. -->
112
+
113
+ [More Information Needed]
114
+
115
+ #### Factors
116
+
117
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
+
119
+ [More Information Needed]
120
+
121
+ #### Metrics
122
+
123
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
+
125
+ [More Information Needed]
126
+
127
+ ### Results
128
+
129
+ [More Information Needed]
130
+
131
+ #### Summary
132
+
133
+
134
+
135
+ ## Model Examination [optional]
136
+
137
+ <!-- Relevant interpretability work for the model goes here -->
138
+
139
+ [More Information Needed]
140
+
141
+ ## Environmental Impact
142
+
143
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
+
145
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
+
147
+ - **Hardware Type:** [More Information Needed]
148
+ - **Hours used:** [More Information Needed]
149
+ - **Cloud Provider:** [More Information Needed]
150
+ - **Compute Region:** [More Information Needed]
151
+ - **Carbon Emitted:** [More Information Needed]
152
+
153
+ ## Technical Specifications [optional]
154
+
155
+ ### Model Architecture and Objective
156
+
157
+ [More Information Needed]
158
+
159
+ ### Compute Infrastructure
160
+
161
+ [More Information Needed]
162
+
163
+ #### Hardware
164
+
165
+ [More Information Needed]
166
+
167
+ #### Software
168
+
169
+ [More Information Needed]
170
+
171
+ ## Citation [optional]
172
+
173
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
+
175
+ **BibTeX:**
176
+
177
+ [More Information Needed]
178
+
179
+ **APA:**
180
+
181
+ [More Information Needed]
182
+
183
+ ## Glossary [optional]
184
+
185
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
+
187
+ [More Information Needed]
188
+
189
+ ## More Information [optional]
190
+
191
+ [More Information Needed]
192
+
193
+ ## Model Card Authors [optional]
194
+
195
+ [More Information Needed]
196
+
197
+ ## Model Card Contact
198
+
199
+ [More Information Needed]
special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<bos>",
3
+ "eos_token": "<eos>",
4
+ "mask_token": "<mask>",
5
+ "pad_token": "<pad>",
6
+ "unk_token": "<unk>"
7
+ }
tokenizer.json ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": "1.0",
3
+ "truncation": null,
4
+ "padding": null,
5
+ "added_tokens": [
6
+ {
7
+ "id": 0,
8
+ "content": "<pad>",
9
+ "single_word": false,
10
+ "lstrip": false,
11
+ "rstrip": false,
12
+ "normalized": false,
13
+ "special": true
14
+ },
15
+ {
16
+ "id": 1,
17
+ "content": "<unk>",
18
+ "single_word": false,
19
+ "lstrip": false,
20
+ "rstrip": false,
21
+ "normalized": false,
22
+ "special": true
23
+ },
24
+ {
25
+ "id": 2,
26
+ "content": "<mask>",
27
+ "single_word": false,
28
+ "lstrip": false,
29
+ "rstrip": false,
30
+ "normalized": false,
31
+ "special": true
32
+ },
33
+ {
34
+ "id": 3,
35
+ "content": "<bos>",
36
+ "single_word": false,
37
+ "lstrip": false,
38
+ "rstrip": false,
39
+ "normalized": false,
40
+ "special": true
41
+ },
42
+ {
43
+ "id": 4,
44
+ "content": "<eos>",
45
+ "single_word": false,
46
+ "lstrip": false,
47
+ "rstrip": false,
48
+ "normalized": false,
49
+ "special": true
50
+ }
51
+ ],
52
+ "normalizer": null,
53
+ "pre_tokenizer": {
54
+ "type": "Split",
55
+ "pattern": {
56
+ "String": ""
57
+ },
58
+ "behavior": "Removed",
59
+ "invert": false
60
+ },
61
+ "post_processor": null,
62
+ "decoder": null,
63
+ "model": {
64
+ "type": "WordPiece",
65
+ "unk_token": "<unk>",
66
+ "continuing_subword_prefix": "##",
67
+ "max_input_chars_per_word": 100,
68
+ "vocab": {
69
+ "<pad>": 0,
70
+ "<unk>": 1,
71
+ "<mask>": 2,
72
+ "<bos>": 3,
73
+ "<eos>": 4,
74
+ "|": 5,
75
+ "X": 6,
76
+ "B": 7,
77
+ "O": 8,
78
+ "U": 9,
79
+ "Z": 10,
80
+ "J": 11,
81
+ "L": 12,
82
+ "A": 13,
83
+ "G": 14,
84
+ "V": 15,
85
+ "S": 16,
86
+ "E": 17,
87
+ "R": 18,
88
+ "T": 19,
89
+ "I": 20,
90
+ "D": 21,
91
+ "P": 22,
92
+ "K": 23,
93
+ "Q": 24,
94
+ "N": 25,
95
+ "F": 26,
96
+ "Y": 27,
97
+ "M": 28,
98
+ "H": 29,
99
+ "W": 30,
100
+ "C": 31
101
+ }
102
+ }
103
+ }
tokenizer.py ADDED
@@ -0,0 +1,304 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from typing import List, Optional, Union, Dict
3
+ from torch import Tensor
4
+
5
+ from itertools import compress
6
+
7
+ # HuggingFace
8
+ from tokenizers import Tokenizer
9
+ from transformers import PreTrainedTokenizerFast, BatchEncoding
10
+ from tokenizers.models import WordPiece
11
+ from tokenizers.pre_tokenizers import Split
12
+
13
+
14
+ VOCAB = {
15
+ "<pad>": 0,
16
+ "<unk>": 1,
17
+ "<mask>": 2,
18
+ "<bos>": 3,
19
+ "<eos>": 4,
20
+ "|": 5,
21
+ "X": 6,
22
+ "B": 7,
23
+ "O": 8,
24
+ "U": 9,
25
+ "Z": 10,
26
+ "J": 11,
27
+ "L": 12,
28
+ "A": 13,
29
+ "G": 14,
30
+ "V": 15,
31
+ "S": 16,
32
+ "E": 17,
33
+ "R": 18,
34
+ "T": 19,
35
+ "I": 20,
36
+ "D": 21,
37
+ "P": 22,
38
+ "K": 23,
39
+ "Q": 24,
40
+ "N": 25,
41
+ "F": 26,
42
+ "Y": 27,
43
+ "M": 28,
44
+ "H": 29,
45
+ "W": 30,
46
+ "C": 31,
47
+ }
48
+
49
+
50
+ class ProteinTokenizer(PreTrainedTokenizerFast):
51
+
52
+ def __init__(
53
+ self,
54
+ pad_token_id: int,
55
+ mask_token_id: int,
56
+ bos_token_id: int,
57
+ eos_token_id: int,
58
+ unk_token_id: int,
59
+ max_length: int = 512,
60
+ other_special_token_ids: Optional[List[int]] = None,
61
+ ambiguous_token_ids: Optional[List[int]] = None, # str = "XBOUZJ"
62
+ **kwargs,
63
+ ):
64
+ """Vocabulary comprising the amino acids, and the special tokens <unk>, <bos>, <eos>, <pad> and <mask>.
65
+
66
+ Args:
67
+ pad_token_id (int): <PAD> token index.
68
+ mask_token_id (int): <MASK> token index.
69
+ bos_token_id (int): <BOS> token index.
70
+ eos_token_id (int): <EOS> token index.
71
+ unk_token_id (int): <UNK> token index.
72
+ other_special_token_ids (Optional[List[int]]): List of additional special tokens.
73
+ """
74
+ # Create vocabulary with special tokens
75
+ token_to_id = dict()
76
+ id_to_token = dict()
77
+
78
+ for token, token_id in VOCAB.items():
79
+ token = token.strip()
80
+ token_to_id[token] = token_id
81
+ id_to_token[token_id] = token
82
+
83
+ # Define tokenizer and model
84
+ tokenizer_object = Tokenizer(WordPiece(vocab=token_to_id, unk_token=id_to_token.get(unk_token_id)))
85
+
86
+ # Pretokenize by splitting every character
87
+ tokenizer_object.pre_tokenizer = Split("", behavior="removed")
88
+
89
+ super().__init__(
90
+ pad_token_id=pad_token_id,
91
+ mask_token_id=mask_token_id,
92
+ bos_token_id=bos_token_id,
93
+ eos_token_id=eos_token_id,
94
+ unk_token_id=unk_token_id,
95
+ max_length=512,
96
+ model_max_length=max_length,
97
+ padding_side="right",
98
+ truncation_side="right",
99
+ pad_token=id_to_token.get(pad_token_id),
100
+ bos_token=id_to_token.get(bos_token_id),
101
+ eos_token=id_to_token.get(eos_token_id),
102
+ unk_token=id_to_token.get(unk_token_id),
103
+ mask_token=id_to_token.get(mask_token_id),
104
+ model_input_names=["input_ids", "attention_mask", "special_tokens_mask"],
105
+ tokenizer_object=tokenizer_object,
106
+ )
107
+
108
+ if other_special_token_ids is not None:
109
+ self.add_special_tokens({"additional_special_tokens": list(id_to_token.get(i) for i in other_special_token_ids)})
110
+
111
+ self.ambiguous_token_ids = ambiguous_token_ids
112
+
113
+ self.key_to_padding = {"input_ids": self.pad_token_id, "attention_mask": 0, "special_tokens_mask": 1, "position_ids": 0}
114
+ self.key_to_dtype = {
115
+ "input_ids": torch.long,
116
+ "attention_mask": torch.bool,
117
+ "special_tokens_mask": torch.bool,
118
+ "position_ids": torch.int,
119
+ }
120
+
121
+ def truncate(
122
+ self,
123
+ encoded_inputs: Dict[str, List[int]],
124
+ max_length: Optional[int] = None,
125
+ random_truncate: bool = True,
126
+ ) -> Dict[str, List[List[int]]]:
127
+ """
128
+ Randomly truncate sequences in encoded inputs to the specified maximum length.
129
+
130
+ Args:
131
+ encoded_inputs (BatchEncoding): Tokenized inputs with keys like 'input_ids' as tensors.
132
+ max_length (Optional[int]): Maximum length for truncation. Defaults to model's max length if None.
133
+ random_truncate (bool): Whether to randomly truncate sequences.
134
+
135
+ Returns:
136
+ Dict[str, List[List[int]]]: Randomly truncated tokenized inputs.
137
+ """
138
+
139
+ for i, sequence in enumerate(encoded_inputs["input_ids"]):
140
+ if len(sequence) > max_length:
141
+ if random_truncate:
142
+ offset = torch.randint(0, len(sequence) - max_length + 1, (1,)).item()
143
+ else:
144
+ offset = 0
145
+ for key in encoded_inputs:
146
+ encoded_inputs[key][i] = encoded_inputs[key][i][offset : offset + max_length]
147
+
148
+ return encoded_inputs
149
+
150
+ def remove_ambiguous(self, encoded_inputs: Dict[str, List[int]]) -> Dict[str, List[List[int]]]:
151
+ """
152
+ Remove ambiguous amino acids from the input sequences.
153
+
154
+ Args:
155
+ encoded_inputs (BatchEncoding): Tokenized inputs with keys like 'input_ids' as tensors.
156
+
157
+ Returns:
158
+ Dict[str, List[List[int]]]: Tokenized inputs without ambiguous amino acids.
159
+ """
160
+
161
+ for i, sequence in enumerate(encoded_inputs["input_ids"]):
162
+ mask = [token not in self.ambiguous_token_ids for token in sequence]
163
+ for key in encoded_inputs:
164
+ encoded_inputs[key][i] = list(compress(encoded_inputs[key][i], mask))
165
+ return encoded_inputs
166
+
167
+ def _pad(
168
+ self,
169
+ encoded_inputs: Dict[str, List[List[int]]],
170
+ padding: Union[bool, str] = True,
171
+ max_length: Optional[int] = None,
172
+ pad_to_multiple_of: int = 8,
173
+ **kwargs,
174
+ ) -> Dict[str, List[List[int]]]:
175
+ """
176
+ Remove ambiguous amino acids from the input sequences.
177
+
178
+ Args:
179
+ encoded_inputs (Dict[str, List[List[int]]): Tokenized inputs with keys like 'input_ids' as tensors.
180
+
181
+ Returns:
182
+ Dict[str, List[List[int]]]: Tokenized inputs without ambiguous amino acids.
183
+ """
184
+
185
+ if isinstance(encoded_inputs, list):
186
+ tmp = dict()
187
+ for key in encoded_inputs[0]:
188
+ tmp[key] = [encoded_inputs[i][key] for i in range(len(encoded_inputs))]
189
+ encoded_inputs = tmp
190
+
191
+ if max_length is None:
192
+ max_length = self.model_max_length
193
+
194
+ sequence_lengths = [len(sequence) for sequence in encoded_inputs["input_ids"]]
195
+ if padding == "longest" or padding == True:
196
+ max_length = min(max_length, max(sequence_lengths))
197
+
198
+ if pad_to_multiple_of is not None and (max_length % pad_to_multiple_of != 0):
199
+ max_length = ((max_length // pad_to_multiple_of) + 1) * pad_to_multiple_of
200
+
201
+ for i, seq_len in enumerate(sequence_lengths):
202
+ if seq_len < max_length:
203
+ for key in encoded_inputs:
204
+ encoded_inputs[key][i] = encoded_inputs[key][i] + [self.key_to_padding[key]] * (max_length - seq_len)
205
+
206
+ return encoded_inputs
207
+
208
+ def pad(
209
+ self,
210
+ encoded_inputs: Dict[str, List[List[int]]],
211
+ padding: Union[bool, str] = True,
212
+ max_length: Optional[int] = None,
213
+ pad_to_multiple_of: int = 8,
214
+ return_tensors: str = "pt",
215
+ **kwargs,
216
+ ) -> Dict[str, List[List[int]]]:
217
+ """
218
+ Remove ambiguous amino acids from the input sequences.
219
+
220
+ Args:
221
+ encoded_inputs (Dict[str, List[List[int]]): Tokenized inputs with keys like 'input_ids' as tensors.
222
+
223
+ Returns:
224
+ Dict[str, List[List[int]]]: Tokenized inputs without ambiguous amino acids.
225
+ """
226
+
227
+ encoded_inputs = self._pad(
228
+ encoded_inputs,
229
+ padding,
230
+ max_length,
231
+ pad_to_multiple_of,
232
+ **kwargs,
233
+ )
234
+
235
+ if return_tensors is not None:
236
+ return BatchEncoding(encoded_inputs, tensor_type=return_tensors)
237
+
238
+ return encoded_inputs
239
+
240
+ def __call__(
241
+ self,
242
+ text: str | List[str],
243
+ max_length: Optional[int] = None,
244
+ padding: Union[bool, str] = False,
245
+ truncation: bool = False,
246
+ random_truncate: bool = True,
247
+ remove_ambiguous: bool = False,
248
+ return_special_tokens_mask: bool = True,
249
+ return_tensors: str = None,
250
+ **kwargs,
251
+ ) -> Dict[str, Tensor]:
252
+
253
+ if isinstance(text, str):
254
+ encoded_inputs = self.__call__(
255
+ [text],
256
+ max_length,
257
+ padding,
258
+ truncation,
259
+ random_truncate,
260
+ remove_ambiguous,
261
+ return_special_tokens_mask,
262
+ return_tensors,
263
+ )
264
+ for key in encoded_inputs:
265
+ encoded_inputs[key] = encoded_inputs[key][0]
266
+ return encoded_inputs
267
+
268
+ # text = [self.bos_token + x + self.eos_token for x in text]
269
+
270
+ # Tokenize without truncation or padding
271
+ encoded_inputs = super().__call__(
272
+ text,
273
+ padding=False,
274
+ truncation=False,
275
+ return_special_tokens_mask=return_special_tokens_mask,
276
+ **kwargs,
277
+ ) # TODO: check EOS, BOS, special tokens mask
278
+
279
+ if max_length is None:
280
+ max_length = self.model_max_length
281
+
282
+ # Track original position indexes
283
+ encoded_inputs["position_ids"] = [list(range(len(seq))) for seq in encoded_inputs["input_ids"]]
284
+
285
+ # Truncate
286
+ if truncation:
287
+ encoded_inputs = self.truncate(
288
+ encoded_inputs,
289
+ max_length=max_length,
290
+ random_truncate=random_truncate,
291
+ )
292
+
293
+ # Remove ambiguous amino acids
294
+ if remove_ambiguous and self.ambiguous_token_ids is not None:
295
+ encoded_inputs = self.remove_ambiguous(encoded_inputs)
296
+
297
+ # Add padding
298
+ if padding:
299
+ encoded_inputs = self._pad(encoded_inputs, max_length=max_length, return_tensors=return_tensors)
300
+
301
+ if return_tensors is not None:
302
+ return BatchEncoding(encoded_inputs, tensor_type=return_tensors)
303
+
304
+ return encoded_inputs
tokenizer_config.json ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "1": {
12
+ "content": "<unk>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "<mask>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "<bos>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "4": {
36
+ "content": "<eos>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "auto_map": {
45
+ "AutoTokenizer": [
46
+ "tokenizer.ProteinTokenizer",
47
+ null
48
+ ]
49
+ },
50
+ "bos_token": "<bos>",
51
+ "bos_token_id": 3,
52
+ "clean_up_tokenization_spaces": false,
53
+ "eos_token": "<eos>",
54
+ "eos_token_id": 4,
55
+ "mask_token": "<mask>",
56
+ "mask_token_id": 2,
57
+ "max_length": 512,
58
+ "model_input_names": [
59
+ "input_ids",
60
+ "attention_mask",
61
+ "special_tokens_mask"
62
+ ],
63
+ "model_max_length": 512,
64
+ "pad_token": "<pad>",
65
+ "pad_token_id": 0,
66
+ "padding_side": "right",
67
+ "tokenizer_class": "ProteinTokenizer",
68
+ "truncation_side": "right",
69
+ "unk_token": "<unk>",
70
+ "unk_token_id": 1
71
+ }