Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update key path #14

Merged
merged 2 commits into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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