Skip to content

Commit

Permalink
include link to Beaker job with Slack noties
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh committed Dec 21, 2024
1 parent 3505660 commit c634066
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/olmo_core/train/callbacks/slack_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from .callback import Callback

SLACK_WEBHOOK_URL_ENV_VAR = "SLACK_WEBHOOK_URL"
BEAKER_JOB_ID_ENV_VAR = "BEAKER_JOB_ID"


class SlackNotificationSetting(StrEnum):
Expand Down Expand Up @@ -110,8 +111,13 @@ def _post_message(self, msg: str):
f"- epoch: {self.trainer.epoch}\n"
f"- tokens: {self.trainer.global_train_tokens_seen:,d}"
)

if self.name is not None:
msg = f"Run `{self.name}` {msg}\n{progress}"
else:
msg = f"Run {msg}\n{progress}"

if BEAKER_JOB_ID_ENV_VAR in os.environ:
msg = f"{msg}\n*Beaker job:* https://beaker.org/job/{os.environ[BEAKER_JOB_ID_ENV_VAR]}"

requests.post(webhook_url, json={"text": msg})

0 comments on commit c634066

Please sign in to comment.