训练任务邮件通知工具,支持模板和系统信息自动附带
Project description
train-notifier
训练任务邮件通知工具,支持模板和系统信息自动附带。
安装
pip install train-notifier
快速使用
1. 创建 .env 文件
SMTP_SERVER=smtp.qq.com
SMTP_PORT=465
SMTP_USER=你的邮箱@qq.com
SMTP_PASS=你的授权码
RECV_EMAIL=收件邮箱@qq.com
2. 代码调用
from notifier import Notifier
n = Notifier()
# 自定义通知
n.notify(title="标题", body="内容")
# 训练完成(无参数)
n.train_done()
# 训练出错
n.train_error(message="CUDA out of memory")
# Epoch 进度
n.epoch_done(epoch=3, total=10, loss=0.0234)
# 任务完成
n.task_done(task_name="数据预处理")
# 自定义提醒
n.alert(message="GPU 温度过高!")
函数列表
| 函数 | 参数 | 说明 |
|---|---|---|
notify(title, body) |
标题, 内容 | 自定义通知 |
train_done() |
无 | 训练完成 |
train_error(message) |
错误信息 | 训练出错 |
epoch_done(epoch, total, loss) |
轮数, 总轮数, 损失值 | Epoch 完成 |
task_done(task_name) |
任务名称 | 任务完成 |
alert(message) |
提醒内容 | 自定义提醒 |
邮件样式
每封邮件包含:
- 紫色渐变头部
- 称呼:尊敬的训练师
- 内容区(左侧色条高亮)
- 系统信息(时间、主机、系统、Python 版本)
许可证
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
train_notifier-1.0.0.tar.gz
(5.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file train_notifier-1.0.0.tar.gz.
File metadata
- Download URL: train_notifier-1.0.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23ba1e710feec26142183b0e70b6f22b6cf027301a952ac44ed74c6e30f6b7da
|
|
| MD5 |
58383221fe987988644cdca404def694
|
|
| BLAKE2b-256 |
88ae346cb3ee42130916f27b65c01948aef47524b14d8effb6b5f22c37d0c75f
|
File details
Details for the file train_notifier-1.0.0-py3-none-any.whl.
File metadata
- Download URL: train_notifier-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cef2056e81542b3e04895522d806e0f25ee436d8259b558b52f5d437084917b
|
|
| MD5 |
5c826b4e08edc809f3525eb5718a7e7e
|
|
| BLAKE2b-256 |
af46c1d72753538f92c70767002f0632c289eaaf5b8ffcd29144288ff19bd001
|