Skip to content

Commit

Permalink
update key path (#14)
Browse files Browse the repository at this point in the history
修复了 #13 中文件保存路径没有同步更改的问题
  • Loading branch information
SAKURA-CAT authored Jun 29, 2024
1 parent 8bfbba1 commit 11a6867
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build-backend = "hatchling.build"

[project]
name = "swankit"
version = "0.1.0"
version = "0.1.1b1"
dynamic = ["readme"]
description = "Base toolkit for SwanLab"
license = "Apache-2.0"
Expand Down
9 changes: 5 additions & 4 deletions swankit/callback/models/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,23 +127,24 @@ def __init__(
"""
当前指标对应本地的行数,error时为None
"""
self.metric_path = None if self.error else os.path.join(logdir, self.key, metric_file_name)
_id = self.column_info.id
self.metric_path = None if self.error else os.path.join(logdir, _id, metric_file_name)
"""
指标文件的路径,error时为None
"""
self.summary_path = None if self.error else os.path.join(logdir, self.key, self.__SUMMARY_NAME)
self.summary_path = None if self.error else os.path.join(logdir, _id, self.__SUMMARY_NAME)
"""
摘要文件的路径,error时为None
"""
self.media_dir = media_dir
"""
静态文件的根文件夹
静态文件的根文件夹,本地保存时需要自己拼接
"""
self.buffers = buffers
"""
需要上传的媒体数据,比特流,error时为None,如果上传为非媒体类型(或Text类型),也为None
"""
# 写入文件名称,对应上传时的文件名称
# 写入文件名称,对应上传时的文件名称:{key}/{文件名称},文件夹名称为key
if self.buffers is not None:
for i, buffer in enumerate(self.buffers):
buffer.file_name = "{}/{}".format(self.key, metric["data"][i])
Expand Down

0 comments on commit 11a6867

Please sign in to comment.