Created
May 16, 2022 20:42
-
-
Save volkanozcan2/e25a4bb1b4d75eaf4b77d0d14921fa13 to your computer and use it in GitHub Desktop.
google colab prevent disconnection if possible.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@markdown #**Anti-Disconnect for Google Colab** | |
#@markdown ## Run this to stop it from disconnecting automatically | |
#@markdown **(disconnects anyhow after 6 - 12 hrs for using the free version of Colab.)** | |
#@markdown *(Pro users will get about 24 hrs usage time[depends])* | |
#@markdown --- | |
import IPython | |
js_code = ''' | |
function ClickConnect(){ | |
console.log("Working"); | |
document.querySelector("colab-toolbar-button#connect").click() | |
} | |
setInterval(ClickConnect,60000) | |
''' | |
display(IPython.display.Javascript(js_code)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment