Sunday, March 12, 2023

AI/ML How to refer a file from Google drive in a python notebook

from google.colab import files

src = list(files.upload().values())[0]

open('utils.py','wb').write(src)


one the file is uploaded, it get copied to the home folder and then can be imported like below 

import utils 


No comments:

Post a Comment