Skip to content

Commit

Permalink
FIX: Don't check wandb assert if not using wandb
Browse files Browse the repository at this point in the history
  • Loading branch information
hijohnnylin committed Mar 26, 2024
1 parent f623ed1 commit 1adefda
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions sae_analysis/dashboard_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,19 +364,20 @@ def run(self):
step=test_idx,
)

# when done zip the folder
shutil.make_archive(self.dashboard_folder, "zip", self.dashboard_folder)
if self.use_wandb:
# when done zip the folder
shutil.make_archive(self.dashboard_folder, "zip", self.dashboard_folder)

# then upload the zip as an artifact
artifact = wandb.Artifact("dashboard", type="zipped_feature_dashboards")
artifact.add_file(f"{self.dashboard_folder}.zip")
assert run is not None # keep pyright happy
run.log_artifact(artifact)
# then upload the zip as an artifact
artifact = wandb.Artifact("dashboard", type="zipped_feature_dashboards")
artifact.add_file(f"{self.dashboard_folder}.zip")
assert run is not None # keep pyright happy
run.log_artifact(artifact)

# terminate the run
run.finish()
# terminate the run
run.finish()

# delete the dashboard folder
shutil.rmtree(self.dashboard_folder)
# delete the dashboard folder
shutil.rmtree(self.dashboard_folder)

return

0 comments on commit 1adefda

Please sign in to comment.