File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ pip install git+https://github.com/Tongjilibo/torch4keras.git
85
85
- **v0.0.1**:20221019 初始版本
86
86
87
87
## 5. 更新:
88
- - **20230907**: 增加from_pretrained和save_pretrained方法,增加log_warn_once方法,compile()中可设置成员变量,默认move_to_model_device设置为True
88
+ - **20230907**: 增加from_pretrained和save_pretrained方法,增加log_warn_once方法,compile()中可设置成员变量,默认move_to_model_device设置为True, 增加JsonConfig
89
89
- **20230901**: compile()可不传参,interval不一致报warning, 去除部分self.vars, 调整move_to_model_device逻辑,DDP每个epoch重新设置随机数,save_weights()和load_weights()可以按照`pretrained`格式
90
90
- **20230821**: 代码结构调整,增加trainer.py文件,方便下游集成
91
91
- **20230812**: 修复DeepSpeedTrainer,修复DDP
Original file line number Diff line number Diff line change @@ -397,6 +397,14 @@ def allowDotting(self, state=True):
397
397
self .__dict__ = self
398
398
else :
399
399
self .__dict__ = dict ()
400
+ KwargsConfig = DottableDict
401
+
402
+
403
+ class JsonConfig :
404
+ '''读取配置文件并返回可.操作符的字典'''
405
+ def __new__ (self , json_path , encoding = 'utf-8' ):
406
+ import json
407
+ return DottableDict (json .load (open (json_path , "r" , encoding = encoding )))
400
408
401
409
402
410
def auto_set_cuda_devices (best_num : Optional [int ] = None ) -> str :
You can’t perform that action at this time.
0 commit comments