Upload model
Browse files
configuration_bionexttager.py
CHANGED
@@ -24,13 +24,5 @@ class BioNextTaggerConfig(PretrainedConfig):
|
|
24 |
self.crf_reduction = crf_reduction
|
25 |
super().__init__(**kwargs)
|
26 |
|
27 |
-
|
28 |
-
print(f"model_path {self._name_or_path}", flush=True)
|
29 |
-
backbonemodel_cfg = AutoConfig.from_pretrained(self._name_or_path,
|
30 |
-
trust_remote_code=True)#.to_dict()
|
31 |
-
for k in backbonemodel_cfg.to_dict():
|
32 |
-
if hasattr(self, k):
|
33 |
-
setattr(backbonemodel_cfg,k, getattr(self,k))
|
34 |
-
#print("BACKend config end?", flush=True)
|
35 |
-
return backbonemodel_cfg
|
36 |
|
|
|
24 |
self.crf_reduction = crf_reduction
|
25 |
super().__init__(**kwargs)
|
26 |
|
27 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
modeling_bionexttagger.py
CHANGED
@@ -23,7 +23,7 @@ class BioNextTaggerModel(PreTrainedModel):
|
|
23 |
super().__init__(config)
|
24 |
self.num_labels = config.num_labels
|
25 |
#print("LOAD BERT?", flush=True)
|
26 |
-
self.bert = BertModel(config
|
27 |
#AutoModel.from_pretrained(config._name_or_path,
|
28 |
# config=config.get_backbonemodel_config(),
|
29 |
# add_pooling_layer=False)
|
|
|
23 |
super().__init__(config)
|
24 |
self.num_labels = config.num_labels
|
25 |
#print("LOAD BERT?", flush=True)
|
26 |
+
self.bert = BertModel(config, add_pooling_layer=False)
|
27 |
#AutoModel.from_pretrained(config._name_or_path,
|
28 |
# config=config.get_backbonemodel_config(),
|
29 |
# add_pooling_layer=False)
|