Xsmos commited on
Commit
86f8cb3
·
verified ·
1 Parent(s): 750c9ac

Fix import error and add source_files to config

Browse files
Files changed (2) hide show
  1. config.json +7 -0
  2. foundation_bert.py +8 -2
config.json CHANGED
@@ -7,6 +7,13 @@
7
  "architectures": [
8
  "FoundationBert"
9
  ],
 
 
 
 
 
 
 
10
  "attention_probs_dropout_prob": 0.1,
11
  "classifier_dropout": null,
12
  "hidden_act": "gelu",
 
7
  "architectures": [
8
  "FoundationBert"
9
  ],
10
+ "source_files": [
11
+ "foundation_bert.py",
12
+ "utils/__init__.py",
13
+ "utils/masked_data_modeling_loss.py",
14
+ "utils/yaml_util.py",
15
+ "train_config.yaml"
16
+ ],
17
  "attention_probs_dropout_prob": 0.1,
18
  "classifier_dropout": null,
19
  "hidden_act": "gelu",
foundation_bert.py CHANGED
@@ -1,7 +1,13 @@
1
- import torch
2
  import os
3
- import yaml
4
  from pathlib import Path
 
 
 
 
 
 
 
5
  from utils.masked_data_modeling_loss import MaskedDataLossWithSoftmax
6
  # from ..utils.contrastive_loss import ContrastiveLoss
7
  from utils.yaml_util import MyLoader
 
1
+ import sys
2
  import os
 
3
  from pathlib import Path
4
+
5
+ current_dir = os.path.dirname(os.path.abspath(__file__))
6
+ if current_dir not in sys.path:
7
+ sys.path.append(current_dir)
8
+
9
+ import torch
10
+ import yaml
11
  from utils.masked_data_modeling_loss import MaskedDataLossWithSoftmax
12
  # from ..utils.contrastive_loss import ContrastiveLoss
13
  from utils.yaml_util import MyLoader