michaeldinzinger commited on
Commit
6f45bb4
·
1 Parent(s): 1fbdd52

Add tokenizer files

Browse files
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2b69ab086c28bf90466ed1c89ba48599df0bc9fac7d7a4b32803cadc73f6fa15
3
  size 571419272
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c540362d99c431f4db180455419fb894da3f8329b2ed60c1d3b405e74693130
3
  size 571419272
modeling_arctic_m_bge_small.py CHANGED
@@ -18,7 +18,7 @@ class ConcatModel(PreTrainedModel):
18
 
19
  def __init__(self, config: ConcatModelConfig):
20
  super().__init__(config)
21
- bert_config = BertConfig(
22
  vocab_size=30522,
23
  hidden_size=768,
24
  num_hidden_layers=12,
@@ -33,10 +33,25 @@ class ConcatModel(PreTrainedModel):
33
  layer_norm_eps=1e-12,
34
  )
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  self.model = nn.ModuleDict(
37
  {
38
- "model_0": BertModel(bert_config),
39
- "model_1": BertModel(bert_config),
40
  }
41
  )
42
 
@@ -45,6 +60,7 @@ class ConcatModel(PreTrainedModel):
45
  input_ids: torch.Tensor,
46
  attention_mask: torch.Tensor,
47
  token_type_ids: torch.Tensor = None,
 
48
  ) -> torch.Tensor:
49
  embeddings = []
50
  for _, model in self.model.items():
 
18
 
19
  def __init__(self, config: ConcatModelConfig):
20
  super().__init__(config)
21
+ bert_config_1 = BertConfig(
22
  vocab_size=30522,
23
  hidden_size=768,
24
  num_hidden_layers=12,
 
33
  layer_norm_eps=1e-12,
34
  )
35
 
36
+ bert_config_2 = BertConfig(
37
+ vocab_size=30522,
38
+ hidden_size=384,
39
+ num_hidden_layers=12,
40
+ num_attention_heads=12,
41
+ intermediate_size=1536,
42
+ hidden_act="gelu",
43
+ hidden_dropout_prob=0.1,
44
+ attention_probs_dropout_prob=0.1,
45
+ max_position_embeddings=512,
46
+ type_vocab_size=2,
47
+ initializer_range=0.02,
48
+ layer_norm_eps=1e-12,
49
+ )
50
+
51
  self.model = nn.ModuleDict(
52
  {
53
+ "model_0": BertModel(bert_config_1),
54
+ "model_1": BertModel(bert_config_2),
55
  }
56
  )
57
 
 
60
  input_ids: torch.Tensor,
61
  attention_mask: torch.Tensor,
62
  token_type_ids: torch.Tensor = None,
63
+ **kwargs
64
  ) -> torch.Tensor:
65
  embeddings = []
66
  for _, model in self.model.items():
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_config.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": true,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "mask_token": "[MASK]",
49
+ "model_max_length": 1000000000000000019884624838656,
50
+ "never_split": null,
51
+ "pad_token": "[PAD]",
52
+ "sep_token": "[SEP]",
53
+ "strip_accents": null,
54
+ "tokenize_chinese_chars": true,
55
+ "tokenizer_class": "BertTokenizer",
56
+ "unk_token": "[UNK]"
57
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff