Is there a way to make Colab give an Audio Notification when cell has finished running

后端 未结 2 2060

I am coding Neural Network models and trainings are long to run so I would like to go doing something else then go back as soon as the cell has finished running.

There

2条回答
  •  野的像风
    2021-02-05 11:03

    Adding an audio notification when a cell completes is a two-liner. For example,

    # Play an audio beep. Any audio URL will do.
    from google.colab import output
    output.eval_js('new Audio("https://upload.wikimedia.org/wikipedia/commons/0/05/Beep-09.ogg").play()')
    

    Here's an example notebook: https://colab.research.google.com/drive/1jrEy5V7FjzAq8Ydg22E1L72xZYsEQWlM

    Edit: Colab now includes a setting that will deliver a browser notification when execution completes in the background. You can enable it in the settings like so:

    The announcement is here: https://twitter.com/GoogleColab/status/1291775273692614659

提交回复
热议问题