emanuelaboros commited on
Commit
982a0e6
1 Parent(s): a8d2245

Upload model

Browse files
Files changed (3) hide show
  1. config.json +1 -1
  2. configuration_extended_multitask.py +45 -0
  3. models.py +1 -1
config.json CHANGED
@@ -5,7 +5,7 @@
5
  ],
6
  "attention_probs_dropout_prob": 0.1,
7
  "auto_map": {
8
- "AutoConfig": "configuration.ImpressoConfig",
9
  "AutoModelForTokenClassification": "models.ExtendedMultitaskModelForTokenClassification"
10
  },
11
  "classifier_dropout": null,
 
5
  ],
6
  "attention_probs_dropout_prob": 0.1,
7
  "auto_map": {
8
+ "AutoConfig": "configuration_extended_multitask.ImpressoConfig",
9
  "AutoModelForTokenClassification": "models.ExtendedMultitaskModelForTokenClassification"
10
  },
11
  "classifier_dropout": null,
configuration_extended_multitask.py ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import PretrainedConfig
2
+
3
+
4
+ class ImpressoConfig(PretrainedConfig):
5
+ model_type = "extended_multitask"
6
+
7
+ def __init__(
8
+ self,
9
+ vocab_size=30522,
10
+ hidden_size=768,
11
+ num_hidden_layers=12,
12
+ num_attention_heads=12,
13
+ intermediate_size=3072,
14
+ hidden_act="gelu",
15
+ hidden_dropout_prob=0.1,
16
+ attention_probs_dropout_prob=0.1,
17
+ max_position_embeddings=512,
18
+ type_vocab_size=2,
19
+ initializer_range=0.02,
20
+ layer_norm_eps=1e-12,
21
+ pad_token_id=0,
22
+ position_embedding_type="absolute",
23
+ use_cache=True,
24
+ classifier_dropout=None,
25
+ pretrained_config=None,
26
+ **kwargs,
27
+ ):
28
+ super().__init__(pad_token_id=pad_token_id, **kwargs)
29
+
30
+ self.vocab_size = vocab_size
31
+ self.hidden_size = hidden_size
32
+ self.num_hidden_layers = num_hidden_layers
33
+ self.num_attention_heads = num_attention_heads
34
+ self.hidden_act = hidden_act
35
+ self.intermediate_size = intermediate_size
36
+ self.hidden_dropout_prob = hidden_dropout_prob
37
+ self.attention_probs_dropout_prob = attention_probs_dropout_prob
38
+ self.max_position_embeddings = max_position_embeddings
39
+ self.type_vocab_size = type_vocab_size
40
+ self.initializer_range = initializer_range
41
+ self.layer_norm_eps = layer_norm_eps
42
+ self.position_embedding_type = position_embedding_type
43
+ self.use_cache = use_cache
44
+ self.classifier_dropout = classifier_dropout
45
+ self.pretrained_config = pretrained_config
models.py CHANGED
@@ -4,7 +4,7 @@ import torch.nn as nn
4
  from transformers import PreTrainedModel, AutoModel, AutoConfig
5
  from torch.nn import CrossEntropyLoss
6
  from typing import Optional, Tuple, Union
7
- from configuration import ImpressoConfig
8
  import logging
9
 
10
  logger = logging.getLogger(__name__)
 
4
  from transformers import PreTrainedModel, AutoModel, AutoConfig
5
  from torch.nn import CrossEntropyLoss
6
  from typing import Optional, Tuple, Union
7
+ from configuration_extended_multitask import ImpressoConfig
8
  import logging
9
 
10
  logger = logging.getLogger(__name__)