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

[REQUEST] 增加未登录实验时swanlab.init的模式二选一 #632

Open
Zeyi-Lin opened this issue Jun 19, 2024 · 5 comments
Open

[REQUEST] 增加未登录实验时swanlab.init的模式二选一 #632

Zeyi-Lin opened this issue Jun 19, 2024 · 5 comments
Assignees
Labels
💪 enhancement New feature or request

Comments

@Zeyi-Lin
Copy link
Member

🤩 Features description [Please make everyone to understand it]

  1. 输入API Key,使用云端版记录
  2. Skip这一步,即使用local
@Zeyi-Lin Zeyi-Lin added the 💪 enhancement New feature or request label Jun 19, 2024
@ShaohonChen
Copy link
Contributor

follow着这个需求hhh

@SAKURA-CAT
Copy link
Contributor

follow着这个需求hhh

好好好

@Puiching-Memory
Copy link
Contributor

这个功能现在可用了吗?0.3.27🤔
目前我的处理方法是这样的:

# 初始化swanlab,启动$swanlab watch ./logs
try:
    swanlab.init(
        project="monolite",
        experiment_name=f"{os.path.basename(args.cfg)}_{datetime.datetime.now().strftime('%Y/%m/%d_%H:%M:%S')}",
    )
except Exception as e:
    logger.error(f"{e}\nInit swanlab in local mode")
    swanlab.init(
        project="monolite",
        experiment_name=f"{os.path.basename(args.cfg)}_{datetime.datetime.now().strftime('%Y/%m/%d_%H:%M:%S')}",
        logdir="./logs",  # 本地模式
        mode="local",
    )

@SAKURA-CAT
Copy link
Contributor

这个功能现在可用了吗?0.3.27🤔 目前我的处理方法是这样的:

# 初始化swanlab,启动$swanlab watch ./logs
try:
    swanlab.init(
        project="monolite",
        experiment_name=f"{os.path.basename(args.cfg)}_{datetime.datetime.now().strftime('%Y/%m/%d_%H:%M:%S')}",
    )
except Exception as e:
    logger.error(f"{e}\nInit swanlab in local mode")
    swanlab.init(
        project="monolite",
        experiment_name=f"{os.path.basename(args.cfg)}_{datetime.datetime.now().strftime('%Y/%m/%d_%H:%M:%S')}",
        logdir="./logs",  # 本地模式
        mode="local",
    )

还不能用,不过如果要写的话差不多内部就是try-catch,这段时间我写一下

@SAKURA-CAT
Copy link
Contributor

SAKURA-CAT commented Dec 6, 2024

要实现这个需求目前有几个需要明确的地方:

  1. 对于非标准终端,比如pycharm这些,在现有的设计上是假设未登录将直接报错,因为无法控制其回显
  2. 实际上所有终端内登录都使用的terminal_login这个函数完成,这个函数导致了当前的逻辑是无法跳过的,如果要实现这个需求就需要改造这个函数或者重写或者上层捕捉。

对于2,从代码破坏性角度考虑是倾向于上层捕捉的,但是这样的逻辑就是:

  1. init
  2. 用户没有api-key,输入ctrl+c
  3. 上层捕获KeyboardInterrupt错误,提示“是否需要切换为本地版本y/n”

这样用户会多一层输入,我不知道是否合理

对于1,是直接报错退出还是什么其他的交互,目前不太明确。

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

No branches or pull requests

4 participants