8000 add save_config · flypythoncom/ner-bert@779d8d4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 779d8d4

Browse files
committed
add save_config
1 parent 85b02b0 commit 779d8d4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/train/train.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ def __init__(self, model, data, best_model_path, lr=0.001, betas=[0.8, 0.9], cli
190190
self.best_target_metric = 0.
191191
self.lr_scheduler = None
192192

193+
def save_config(self, path):
194+
with open(path, "w") as file:
195+
json.dump(self.config, file)
196+
193197
@classmethod
194198
def from_config(cls, path):
195199
with open(path, "r") as file:

0 commit comments

Comments
 (0)
0