Download code/wb.py from ASSERT-KTH/codi-trace: direct link, hf CLI and curl.
- Browser
- Download file 629 Bytes
-
https://huggingface.co/ASSERT-KTH/codi-trace/resolve/main/code/wb.py
- Command line
-
hf download hf://ASSERT-KTH/codi-trace/code/wb.py
-
curl -L -o wb.py https://huggingface.co/ASSERT-KTH/codi-trace/resolve/main/code/wb.py
629 Bytes
| """wandb: default-on, offline (compute nodes have no internet -> `wandb sync` later), | |
| never blocks training. Returns report_to for TrainingArguments.""" | |
| import os | |
| def wandb_init(args, stage): | |
| if int(os.environ.get("RANK", "0")) != 0: # rank0 only under DDP | |
| return [] | |
| try: | |
| import wandb | |
| os.environ.setdefault("WANDB_MODE", "offline") | |
| wandb.init(project="codi_trace", name=f"{stage}-{os.path.basename(args.output_dir)}", | |
| dir=args.output_dir, config=vars(args)) | |
| return ["wandb"] | |
| except Exception as e: | |
| print(f"wandb disabled: {e}") | |
| return [] | |