Set_colab_file_id

what does the below statement do?

jovian.utils.colab.set_colab_file_id(‘17goYVSmiHkziswllkPTJPdloIhHTy0er’)

Can someone explain me, please?

From jovian source:
obraz
More or less it just sets the colab file ID to an ID passed as an argument.

No idea why would you have to use it, because even the package name says it’s utils. This function doesn’t have any docs whatsoever so I suppose it’s only used internally. Usually you wouldn’t have to use it.

Where did you found it?

I’m only guessing that it is used whenever the automatic detection of the file ID fails. But it shouldn’t happen to be honest :stuck_out_tongue:

Thanks for replying, I guess I found why it is used for? He is using this to find out which notebook it is.

it is the last line in the first block of the cell? Im figuring out what it does?

Anyways, thanks for helping me understand

Did you understand from where to get the file ID for any file?

1 Like

How to get the file_id if we create a file at colab and would like to save an instance at jovian?
I just understood these following steps but do not know how to get file_id of my present file.

!pip install jovian --upgrade -q
import jovian
jovian.utils.colab.set_colab_file_id('INSERT FILE ID')

import jovian

jovian.commit(project='example001')

Somebody from forum did mentioned that the file ID can be copied from part of URL of current file or from a part of ‘link sharing’, nothing is working for me.
The error shows:
ApiError: Colab commit failed: (HTTP 404) No file found for the provided File ID

But when i check, file does exists in my google drive.

Using colab + jovian together for first time. It will help us if there is video of this explaining how to create a new file at colab, the file ID and how to save that same colab file at jovian.
(Though we did understood when this was explained in binder and local case where file ID wasn’t something which was required there.)

Thank you sir.

EDIT: I would like to add, the reverse works. e.g.:

  1. Create new notebook at jovian
  2. ‘Run’ at colab
  3. same commands as i stated above beside file_id is automatically generated and is ofcourse unique.
  4. commit.

TL ; DR In short, I would like to know how to save an instance of a notebook at jovian if the file is created at colab. What will be the corresponding file_ID.

1 Like

I wonder if downloading the notebook from colab then uploading to jovian and then running through colab again would help :thinking:

1 Like