Suppose I have to move out 3 hours away from my girlfriend's apartment, and I am running a Colab Environment. I can't stop the process and I need to bring my computer with me. How can I prevent the running process from being disconnected?
I have tried that question, but I think the Google Colab Interface has changed a bit, so the answers are no longer up-to-date.
There are many answers there. Currently for me works perfectly to go to the console and type
function ClickConnect(){
console.log("Clicked on connect button");
document.querySelector("colab-connect-button").click()
}
setInterval(ClickConnect,60000)
Take note that this should prevent disconnecting after each 1.5 hours of inactivity, but each runtime, if you don't have Colab Pro, will be terminated after 12 hours.
Edit:
I have tested my self and come up that this works:
function ClickConnect(){
console.log("Clicked on connect button");
document.querySelector("#ok").click()
}
setInterval(ClickConnect,60000)
Note that it will throw an error, its ok, it means that the Disconnection notification is not shown. Once it appear it will be clicked to reconnect.
There is this article from towards science that might help you prevent colab from disconecting
As a second thought, I think that as long as your laptop stays connected and active to a network it will keep running, so, an alternative is to use your phone as a hotspot to connect; use ethernet && wifi all together in order when you remove the cable you'll still be connected. But you have to keep your laptop open so you need battery fully charged; otherwise use a different device to start colab from like phone or tablet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With