# Wandb 複製 runs ### <font color = 'red'>Notice!!! 以系統管理員身分執行 Terminal or su 進入超級用戶 !!!</font> ```python import wandb wandb.login() api = wandb.Api() src_entity = "src_entity" # 改成自己的 entity src_project = "src_project" # 改成自己的 project src_name = "src_name" # 改成自己的 run name dst_entity = "dst_entity" # 改成自己的 entity dst_project = "dst_project" # 改成自己的 project runs = api.runs(f"{src_entity}/{src_project}") for run in runs: if run.name == src_name: history = run.history() files = run.files() new_run = wandb.init(project=dst_project, entity=dst_entity, config=run.config, name=run.name, resume="allow") for index, row in history.iterrows(): row = row.dropna().to_dict() new_run.log(row, step = int(row['_step'])) for file in files: file.download(replace=True) new_run.save(file.name, policy="now") new_run.finish() ```