Using a Google Colab Notebook in Anvil

Is there a way to connect a GC notebook to be used in Anvil?

I know its possible to connect a Jupyter Notebook with Anvil Uplink, but I would like to use the GPUs of Colab for a project that I have in mind.

Absolutely. Just !pip install anvil-uplink in Colab, and proceed as you would normally on a local computer.

1 Like

Do you know if this work once the Colab instance sleeps?

I’m not sure.

Colab times out after 90min if the notebook is idle (or browser is closed), or after 12 hours total usage.

Perhaps you can prevent the notebook from idling by using anvil.server.wait_forever().

I appreciate it. I’ll play around with it.

I’ve been looking for a way to call a Colab from a script but I’m not having any luck.

My pleasure.

Ah, I see. Perfect opportunity for uplink!

1 Like