训练任务邮件通知工具,支持模板和系统信息自动附带
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.1.tar.gz
(5.5 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.1.tar.gz.
File metadata
- Download URL: train_notifier-1.0.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
088aa01454c9f9540ecd618bb50e77920dee04ce6d09db3e340c9ce56011b6e0
|
|
| MD5 |
3004c38872f5aec74987e0a5d2046f4f
|
|
| BLAKE2b-256 |
a6a097446ee66730ecadaecb6b25c2429973bcfaf6fc5eb7a79f79b023918f26
|
File details
Details for the file train_notifier-1.0.1-py3-none-any.whl.
File metadata
- Download URL: train_notifier-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2560eea642c5e7c4a99e2c98dd11dbc3419beffb64ba0835f7bb0a8fd9630197
|
|
| MD5 |
7c8689e01280743b8a31f898bbe5c8af
|
|
| BLAKE2b-256 |
cfd87d30bd278c922c89a721942fdbf4ef70be17ab91ec00e92190baef2a6eb1
|