Skip to content

[Feature] Add Swanlab Slack notification #4887

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dykderrick
Copy link
Contributor

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

Adds support for Swanlab notifications via Slack.

This change introduces the swanlab_notification_methods parameter, allowing users to specify which notification channels (Lark and/or Slack) should be used to receive experiment updates. It also includes corresponding parameters for the Lark and Slack webhook URLs and necessary logic to register the appropriate callbacks based on the selected notification methods.

Related PR #4830 and Issue #4829.

Experiment results

cli
Screenshot 2025-07-09 at 16 32 21

slack
Slack 2025-07-09 16 48 58

web-ui
image

Adds support for Swanlab notifications via Slack.

This change introduces the `swanlab_notification_methods` parameter,
allowing users to specify which notification channels (Lark and/or Slack)
should be used to receive experiment updates. It also includes corresponding
parameters for the Lark and Slack webhook URLs and necessary logic to
register the appropriate callbacks based on the selected notification methods.
@@ -83,14 +89,20 @@ def _init_swanlab(self):
if self.swanlab_token:
swanlab.login(self.swanlab_token)

if self.swanlab_lark_webhook_url is not None:
if 'lark' in self.swanlab_notification_methods and self.swanlab_lark_webhook_url is not None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An error will occur if self.swanlab_notification_methods is None.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if self.swanlab_notification_methods and 'lark' in self.swanlab_notification_methods and self.swanlab_lark_webhook_url is not None:

Would this argument be too long? Do you think if self.swanlab_notification_methods variable is needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants