Skip to content

Commit

Permalink
new wandb to plot script
Browse files Browse the repository at this point in the history
  • Loading branch information
soldni committed Nov 25, 2023
1 parent f50ce07 commit 121aaf6
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions scripts/wandb_to_plot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import argparse
import re
from necessary import necessary

with necessary(["plotly", "wandb"]):
import plotly
import wandb


def parse_args():
ap = argparse.ArgumentParser()
ap.add_argument(
"-t", "--wandb-team", type=str, required=True, help="Name of the wandb team to use, e.g. 'ai2-llm'"
)
ap.add_argument(
"-p",
"--wandb-project",
type=str,
required=True,
help="Name of the wandb project to use, e.g. 'olmo-small'",
)
ap.add_argument(
"-n", "--wandb-name", type=str, required=True, help="Run name or regex to use, e.g. '3T-lower-tie-.*'"
)
ap.add_argument(
"-x",
"--x-axis",
type=str,
default="throughput/total_tokens",
)
ap.add_argument(
"-y",
"--y-axis",
nargs="+",
type=str,
default=["train/Perplexity"]
)
return ap.parse_args()


def main():
opts = parse_args()

# make sure we're logged in
wandb.login()

api = wandb.Api()
runs = api.runs(f"{opts.wandb_team}/{opts.wandb_project}")

re_run_name = re.compile(opts.wandb_name)

for wb_run in runs:
if not re_run_name.search(wb_run.name):
continue

import ipdb

ipdb.set_trace()


if __name__ == "__main__":
main()

0 comments on commit 121aaf6

Please sign in to comment.