Update: add_text

This commit is contained in:
Ayush Chaurasia 2021-07-14 17:29:32 +05:30 committed by Eren Gölge
parent 9fcf48b760
commit 79b74a989d
3 changed files with 5 additions and 5 deletions

View File

@ -236,7 +236,7 @@ class BaseTrainingConfig(Coqpit):
Defaults to ```False```. Defaults to ```False```.
project_name (str): project_name (str):
Name of the W&B project. Defaults to config.model Name of the project. Defaults to config.model
wandb_entity (str): wandb_entity (str):
Name of W&B entity/team. Enables collaboration across a team or org. Name of W&B entity/team. Enables collaboration across a team or org.

View File

@ -168,7 +168,6 @@ class Trainer:
if self.dashboard_logger is None: if self.dashboard_logger is None:
if config.dashboard_logger == "tensorboard": if config.dashboard_logger == "tensorboard":
self.dashboard_logger = TensorboardLogger(output_path, model_name=config.model) self.dashboard_logger = TensorboardLogger(output_path, model_name=config.model)
self.dashboard_logger.add_text("model-config", f"<pre>{config.to_json()}</pre>", 0)
elif config.dashboard_logger == "wandb": elif config.dashboard_logger == "wandb":
project_name = config.model project_name = config.model
@ -181,6 +180,8 @@ class Trainer:
config=config, config=config,
entity=config.wandb_entity, entity=config.wandb_entity,
) )
self.dashboard_logger.add_text("model-config", f"<pre>{config.to_json()}</pre>", 0)
if not self.config.log_model_step: if not self.config.log_model_step:
self.config.log_model_step = self.config.save_step self.config.log_model_step = self.config.save_step
@ -1147,7 +1148,6 @@ def process_args(args, config=None):
if config.dashboard_logger == "tensorboard": if config.dashboard_logger == "tensorboard":
dashboard_logger = TensorboardLogger(config.output_path, model_name=config.model) dashboard_logger = TensorboardLogger(config.output_path, model_name=config.model)
dashboard_logger.add_text("model-config", f"<pre>{config.to_json()}</pre>", 0)
elif config.dashboard_logger == "wandb": elif config.dashboard_logger == "wandb":
project_name = config.model project_name = config.model
@ -1160,7 +1160,7 @@ def process_args(args, config=None):
config=config, config=config,
entity=config.wandb_entity, entity=config.wandb_entity,
) )
dashboard_logger.add_text("model-config", f"<pre>{config.to_json()}</pre>", 0)
c_logger = ConsoleLogger() c_logger = ConsoleLogger()
return config, experiment_path, audio_path, c_logger, dashboard_logger return config, experiment_path, audio_path, c_logger, dashboard_logger

View File

@ -86,7 +86,7 @@ class WandbLogger:
self.dict_to_figure(f"{self.model_name}_TestFigures", figures) self.dict_to_figure(f"{self.model_name}_TestFigures", figures)
def add_text(self, title, text, step): def add_text(self, title, text, step):
self.log_dict[title] = wandb.HTML(f"<p> {text} </p>") pass
def flush(self): def flush(self):
if self.run: if self.run: