Skip to content

Commit

Permalink
add publish function to wandb (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriihavrylko authored Feb 11, 2024
1 parent 3f001a6 commit ab633c0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/src/helpers/wandb_registry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import wandb

def publish_model(model_path, project, name, model_type="model"):
run = wandb.init(project=project, job_type="model-publishing")
artifact = wandb.Artifact(name, type=model_type)
artifact.add_dir(model_path)
run.log_artifact(artifact)
run.finish()
print(f"Published {name} to W&B")

0 comments on commit ab633c0

Please sign in to comment.