Skip to main content

Sends telegram messages informing user about ML training job progress.

Project description

Tensorflow Training Notifier

A python package which periodically notifies you of your Tensorflow job's progress.

Installation

The python package can be installed via pip.

pip install tf-training-notifier

Setup

The package relies on two envionrmnet variables ("TRAINING_NOTIFIER_TOKEN" and "TRAINING_NOTIFIER_CHAT_ID") being set. These variables point towards the Telegram bot token and the Telegram chat ID. Instructions on how to get and set those up can be found here.

Usage

Setting up the notifier

import trainingnotifier
EPOCHS = 15
# The default notifier which only notifies the user when the job is completed.
notifier = trainingnotifier.NotifierCallback(EPOCHS)
model.fit(x_train, y_train, epochs=EPOCHS, callbacks=[notifier])
# Creates a notifier that will update the user ONCE (if the job takes more than 2 minutes) 
#  when the job is done. It will also report the loss in this message.
notifier = trainingnotifier.NotifierCallback(EPOCHS, min_time="2m", metrics=["loss"])
# Creates a new notifier that will notify the user, at soonest, every 10 minutes with 
#  the jobs ETA and loss values. If the job takes longer than 10 minutes than it will send 
#  a notification that the job is done
notifier = trainingnotifier.NotifierCallback(EPOCHS, epoch_updates=True, min_time="10m", metrics=["loss"])

To test if the system was setup properly.

# This function tests the notification system. If the target user recieves a Telegram test 
#  message, then the enviornment variables have been set correctly.
trainingnotifier.test_notifier()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tf-training-notifier-1.0.3.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

tf_training_notifier-1.0.3-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file tf-training-notifier-1.0.3.tar.gz.

File metadata

  • Download URL: tf-training-notifier-1.0.3.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for tf-training-notifier-1.0.3.tar.gz
Algorithm Hash digest
SHA256 da082704862bcf263bf3c55107dcaed8d8bb373720e11abfcc79d87e2dafe871
MD5 b1176631639728827c91e3bb72c20938
BLAKE2b-256 b050a5e55e6d3c896c839fee0ae5d4443291d89d3ea5bd216ebb2d58b7962655

See more details on using hashes here.

File details

Details for the file tf_training_notifier-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for tf_training_notifier-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 13b793a576a580ebbd9e646aaf5bac32eca02e34b5f6edc8ca592098c8aa1d53
MD5 9b0523be1a3acf6935ac72995d15154a
BLAKE2b-256 37a11d5c6827735e58b96f6b436e093acfd43ba8e49db6f33086a11f70c698b3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page