ltg
/

PyTorch
English
custom_code
davda54 commited on
Commit
ec1b5eb
β€’
1 Parent(s): 7f321a9

initial upload

Browse files
config.json CHANGED
@@ -22,5 +22,6 @@
22
  "num_hidden_layers": 12,
23
  "position_bucket_size": 32,
24
  "torch_dtype": "float32",
25
- "vocab_size": 8192
 
26
  }
 
22
  "num_hidden_layers": 12,
23
  "position_bucket_size": 32,
24
  "torch_dtype": "float32",
25
+ "vocab_size": 16384,
26
+ "temperature": 2.5
27
  }
configuration_ltgbert.py CHANGED
@@ -17,6 +17,7 @@ class LtgbertConfig(PretrainedConfig):
17
  num_hidden_layers=12,
18
  layer_norm_eps=1.0e-7,
19
  output_all_encoded_layers=True,
 
20
  **kwargs,
21
  ):
22
  super().__init__(**kwargs)
@@ -32,3 +33,4 @@ class LtgbertConfig(PretrainedConfig):
32
  self.output_all_encoded_layers = output_all_encoded_layers
33
  self.position_bucket_size = position_bucket_size
34
  self.layer_norm_eps = layer_norm_eps
 
 
17
  num_hidden_layers=12,
18
  layer_norm_eps=1.0e-7,
19
  output_all_encoded_layers=True,
20
+ temperature=1.0,
21
  **kwargs,
22
  ):
23
  super().__init__(**kwargs)
 
33
  self.output_all_encoded_layers = output_all_encoded_layers
34
  self.position_bucket_size = position_bucket_size
35
  self.layer_norm_eps = layer_norm_eps
36
+ self.temperature = temperature
modeling_ltgbert.py CHANGED
@@ -443,6 +443,7 @@ class Classifier(nn.Module):
443
  def __init__(self, config, num_labels: int):
444
  super().__init__()
445
 
 
446
  drop_out = getattr(config, "cls_dropout", None)
447
  drop_out = config.hidden_dropout_prob if drop_out is None else drop_out
448
 
@@ -456,7 +457,7 @@ class Classifier(nn.Module):
456
  )
457
 
458
  def forward(self, x):
459
- x = self.nonlinearity(x)
460
  return x
461
 
462
 
 
443
  def __init__(self, config, num_labels: int):
444
  super().__init__()
445
 
446
+ self.temperature = config.temperature
447
  drop_out = getattr(config, "cls_dropout", None)
448
  drop_out = config.hidden_dropout_prob if drop_out is None else drop_out
449
 
 
457
  )
458
 
459
  def forward(self, x):
460
+ x = self.nonlinearity(x) / self.temperature
461
  return x
462
 
463
 
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5e1e5fbe6e83f2268d4f30334df9e64bbb4cc5a2e2986d60594e2c9f27cbf60a
3
- size 130639876
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e5aaa5fba47a98d324a6af79ec8a03fe32c6abf1a483c0274075d5faa9e5d6a6
3
+ size 503044925
spacial_tokens_map.json CHANGED
@@ -1 +1 @@
1
- {"bos_token": "␂", "eos_token": "␃", "unk_token": "␦", "sep_token": "␃", "pad_token": "␒", "cls_token": "␂", "mask_token": "β₯"}
 
1
+ {"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<oad>", "cls_token": "<s>", "mask_token": "<mask>"}
tokenizer.json CHANGED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json CHANGED
@@ -1,10 +1,10 @@
1
  {
2
  "tokenizer_class": "PreTrainedTokenizerFast",
3
- "bos_token": "␂",
4
- "eos_token": "␃",
5
- "unk_token": "␦",
6
- "sep_token": "␃",
7
- "pad_token": "␒",
8
- "cls_token": "␂",
9
- "mask_token": "β₯"
10
  }
 
1
  {
2
  "tokenizer_class": "PreTrainedTokenizerFast",
3
+ "bos_token": "<s>",
4
+ "eos_token": "</s>",
5
+ "unk_token": "<unk>",
6
+ "sep_token": "</s>",
7
+ "pad_token": "<pad>",
8
+ "cls_token": "<s>",
9
+ "mask_token": "<mask>"
10
  }