Skip to content

Conversation

Zeyi-Lin
Copy link
Member

@Zeyi-Lin Zeyi-Lin commented Jun 19, 2025

Description

增加1个插件LogdirFileWriter,它的作用是:支持传入1个文件路径列表,会在执行swanlab.init时,将文件复制到对应的run文件夹下

参数:

  • sub_dir:如果不为None,则在run目录下创建1个sub_dir文件夹来保存文件
  • file_path:支持传入1个文件路径列表(也支持仅传入1个str)

Related Issue: #1106

测试代码:

from swanlab.plugin.writer import LogdirConfigWriter
import swanlab

logdir_config_writer = LogdirConfigWriter(
    sub_dir="code",
    file_path=["a.py", "b.py"],
)
swanlab.register_callbacks([logdir_config_writer])

swanlab.init()

@SAKURA-CAT SAKURA-CAT merged commit 3f2cd3e into main Jun 19, 2025
5 checks passed
@SAKURA-CAT SAKURA-CAT deleted the feat/logdir-file-writer branch June 20, 2025 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants