From 2ae56b3596cfb74009bee2355efda92d44fc5b78 Mon Sep 17 00:00:00 2001 From: KAAANG <79990647+SAKURA-CAT@users.noreply.github.com> Date: Tue, 11 Feb 2025 19:08:24 +0800 Subject: [PATCH] fix: invalid print --- requirements.txt | 2 +- swanlab/data/sdk.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 405d0833..774d3ce9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -swankit==0.1.2b6 +swankit==0.1.3 swanboard==0.1.7b1 cos-python-sdk-v5 urllib3>=1.26.0 diff --git a/swanlab/data/sdk.py b/swanlab/data/sdk.py index 385a7f1f..53b9fd4e 100644 --- a/swanlab/data/sdk.py +++ b/swanlab/data/sdk.py @@ -248,7 +248,7 @@ def wrapper(*args, **kwargs): @should_call_after_init("You must call swanlab.init() before using log()") -def log(data: Dict[str, DataType], step: int = None): +def log(data: Dict[str, DataType], step: int = None, print_to_console: bool = False): """ Log a row of data to the current run. We recommend that you log data by SwanLabRun.log() method, but you can also use this function to log data. @@ -262,9 +262,12 @@ def log(data: Dict[str, DataType], step: int = None): step : int, optional The step number of the current data, if not provided, it will be automatically incremented. If step is duplicated, the data will be ignored. + print_to_console : bool, optional + Whether to print the data to the console, the default is False. """ run = get_run() ll = run.log(data, step) + print_to_console and print(ll) return ll