// remove paths
keys = ["train_dataset", "val_dataset"]
for k in keys:
try:
metadata[k].pop("folder")
except:
pass
if isinstance(metadata["config"], str):
metadata["config"] = json.loads(metadata["config"])
metadata["separation_class"] = type(self).__name__
metadata["model_name"] = metadata["config"]["name"]
After Change
if for_upload or truncate_loss:
if "trainer.state.epoch_history" in metadata:
loss_history = metadata.pop("trainer.state.epoch_history")
metadata["final_loss"] = {k: float(v[-1]) for k, v in loss_history.items()}
if isinstance(metadata["config"], str):
metadata["config"] = json.loads(metadata["config"])
metadata["separation_class"] = type(self).__name__