当单元运行完毕时,有没有办法让Colab发出音频通知 [英] Is there a way to make Colab give an Audio Notification when cell has finished running

查看:149
本文介绍了当单元运行完毕时,有没有办法让Colab发出音频通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编码神经网络模型,并且训练需要很长时间才能运行,所以我想做其他事情,然后在单元运行完毕后立即返回.

已经有一种跟踪此方法的方法,因为忙碌"时标签"图标为灰色,完成后为黄色".但是我在音频通知旁边找不到其他东西.

解决方案

在单元格完成时添加音频通知是两层的.例如,

# 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()')

这是一个示例笔记本: https://colab.research.google.com/drive/1jrEy5V7FjzAq8Ydg22E1L72xZYs>

编辑:Colab现在包含一个设置,该设置将在后台执行完成时传递浏览器通知.您可以在类似的设置中启用它:

公告在这里: https://twitter.com/GoogleColab/status/1291775273692614659

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 is already a way to track this since the Tab Icon is grey when busy then yellow when done. But I can't find something abut audio notifications.

解决方案

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

这篇关于当单元运行完毕时,有没有办法让Colab发出音频通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆