This commit is contained in:
hailin 2025-09-09 09:43:20 +08:00
parent c684b74b85
commit 4d896e6d2b
1 changed files with 11 additions and 5 deletions

View File

@ -5,14 +5,20 @@ export WANDB_PROJECT=ds-qwen3
export WANDB_GROUP=q3-32b-ds4-2025-09-04
python3 - <<'PY'
import os, wandb
api = wandb.Api(overrides={"base_url": os.environ.get("WANDB_BASE_URL")})
entity = os.environ['WB_ENTITY']; project = os.environ['WANDB_PROJECT']; group = os.environ['WANDB_GROUP']
runs = api.runs(entity=entity, project=project, filters={"group": group})
import os, wandb, sys
api = wandb.Api(overrides={"base_url": os.environ["WANDB_BASE_URL"]})
path = f'{os.environ["WB_ENTITY"]}/{os.environ["WANDB_PROJECT"]}'
group = os.environ["WANDB_GROUP"]
runs = api.runs(path=path, filters={"group": group})
cnt = 0
for r in runs:
print("Deleting:", r.name, r.id)
r.delete(delete_artifacts=True)
try:
r.delete(delete_artifacts=True)
except TypeError:
# 旧版本没有 delete_artifacts 参数
r.delete()
cnt += 1
print(f"Deleted {cnt} runs in group '{group}'.")
PY