Skip to content

Commit d9456d8

Browse files
committed
v0.2.3
1 parent cc66396 commit d9456d8

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ pip install git+https://github.com/Tongjilibo/torch4keras.git
6868
## 4. 版本历史
6969
|更新日期| 版本 | 版本说明 |
7070
|------| ----------------- |----------- |
71+
|20240603|v0.2.3|去除对torch依赖,snippets部分可用;移动bert4torch中snippets|
7172
|20240418|v0.2.2|增加YamlConfig和IniConfig, 优化deepspeed的使用,修复`_prepare_inputs`的bug,修复断点续训`SmoothMetricsCallback`起点错误的bug, Trainer断点续训记录batch数|
7273
|20240317|v0.2.1.post2 |训练异常时保存权重,避免空数据集error,默认指标使用滑窗平滑,BaseModelDDP修改的更易用,mapping允许是函数更易用,Checkpoint增加save_on_train_end,增加SystemCallback,修改run_callback=False的bug, 适配build_MiniLLM_from_scratch, 修复ddp中mix_precision和torch重名的bug|
73-
|20240221|v0.2.0 | fit中修改.train()逻辑较少耗时|
7474
7575
[更多版本](https://github.com/Tongjilibo/torch4keras/blob/master/docs/Update.md)
7676

docs/History.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## 更新历史
22

3+
- **20240603**: 去除对torch依赖,snippets部分可用;移动bert4torch中snippets
34
- **20240418**: 增加YamlConfig和IniConfig, 优化deepspeed的使用,修复`_prepare_inputs`的bug,修复断点续训`SmoothMetricsCallback`起点错误的bug, Trainer断点续训记录batch数
45
- **20240317**: 训练异常时保存权重,避免空数据集error,默认指标使用滑窗平滑,BaseModelDDP修改的更易用,mapping允许是函数更易用,Checkpoint增加save_on_train_end,增加SystemCallback,修改run_callback=False的bug, 适配build_MiniLLM_from_scratch, 修复ddp中mix_precision和torch重名的bug
56
- **20240221**: fit中修改.train()逻辑减少耗时

docs/Update.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
|更新日期| 版本 | 版本说明 |
44
|------| ----------------- |----------- |
5+
|20240603|v0.2.3|去除对torch依赖,snippets部分可用;移动bert4torch中snippets|
56
|20240418|v0.2.2|增加YamlConfig和IniConfig, 优化deepspeed的使用,修复`_prepare_inputs`的bug,修复断点续训`SmoothMetricsCallback`起点错误的bug, Trainer断点续训记录batch数|
67
|20240317|v0.2.1.post2 |训练异常时保存权重,避免空数据集error,默认指标使用滑窗平滑,BaseModelDDP修改的更易用,mapping允许是函数更易用,Checkpoint增加save_on_train_end,增加SystemCallback,修改run_callback=False的bug, 适配build_MiniLLM_from_scratch, 修复ddp中mix_precision和torch重名的bug|
78
|20240221|v0.2.0 | fit中修改.train()逻辑减少耗时|

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name='torch4keras',
10-
version='v0.2.2',
10+
version='v0.2.3',
1111
description='Use torch like keras',
1212
long_description=long_description,
1313
long_description_content_type="text/markdown",

torch4keras/snippets/monitor.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ def end(self, verbose=1):
188188
self.cost['avg_' + k] = self.cost[k] / v
189189

190190
if verbose > 0:
191-
log_info('Cost detail')
192-
pprint(self.cost)
193-
print()
194-
195-
self.reset()
196-
return self.cost
191+
log_info(f'Cost detail: {self.cost}')
192+
self.reset()
193+
else:
194+
cost = copy.deepcopy(self.cost)
195+
self.reset()
196+
return cost
197197

198198

199199
def send_email(mail_receivers:Union[str,list], mail_subject:str, mail_msg:str="", mail_host:str=None,

0 commit comments

Comments
 (0)