Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor improvements to wandb logging #155

Merged
merged 6 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/rl_gsm8k/orchestrate_rl.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def main(cfg: DictConfig):
exp_path = Path(cfg.output_dir)
setup_logging(exp_path)
logger.info(f"Current dir: {os.getcwd()}, output dir: {cfg.output_dir}")
cfg.finetune.wandb_id = exp_path.name
cfg.finetune.wandb_id = str(exp_path).replace("/", "_")
run = init_wandb(cfg, exp_path, flatten_dict_config(cfg))
if run is None:
raise ValueError("Failed to initialize wandb run")
Expand Down
6 changes: 6 additions & 0 deletions tapeagents/finetune/logging_.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from importlib.metadata import distributions
import json
import logging
import os
Expand Down Expand Up @@ -28,6 +29,11 @@ def init_wandb(
if config_for_wandb is None:
config_for_wandb = cfg.dict()

python_env = {}
for dist in distributions():
python_env[dist.metadata['Name']] = dist.version
config_for_wandb["python_env"] = python_env

wandb_id = cfg.finetune.wandb_id

if cfg.finetune.wandb_resume == "always":
Expand Down