Skip to content

Instantly share code, notes, and snippets.

@vsay01
Last active June 1, 2021 16:38
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save vsay01/12ff13b05d768dc2d4f4646fbf41cd33 to your computer and use it in GitHub Desktop.
Save vsay01/12ff13b05d768dc2d4f4646fbf41cd33 to your computer and use it in GitHub Desktop.
# Clone github repository setup
# import join used to join ROOT path and MY_GOOGLE_DRIVE_PATH
from os.path import join
# path to your project on Google Drive
MY_GOOGLE_DRIVE_PATH = 'My Drive/MyDrive/Udacity/deep-learning-v2-pytorch'
# replace with your Github username
GIT_USERNAME = "vsay01"
# definitely replace with your
GIT_TOKEN = "{YOUR_GITHUB_TOKEN}"
# Replace with your github repository in this case we want
# to clone deep-learning-v2-pytorch repository
GIT_REPOSITORY = "deep-learning-v2-pytorch"
PROJECT_PATH = join(ROOT, MY_GOOGLE_DRIVE_PATH)
# It's good to print out the value if you are not sure
print("PROJECT_PATH: ", PROJECT_PATH)
# In case we haven't created the folder already; we will create a folder in the project path
!mkdir "{PROJECT_PATH}"
#GIT_PATH = "https://{GIT_TOKEN}@github.com/{GIT_USERNAME}/{GIT_REPOSITORY}.git" this return 400 Bad Request for me
GIT_PATH = "https://" + GIT_TOKEN + "@github.com/" + GIT_USERNAME + "/" + GIT_REPOSITORY + ".git"
print("GIT_PATH: ", GIT_PATH)
@ezbelman
Copy link

ezbelman commented Jun 1, 2021

Hello, i have an error when i execute this code, " NameError: name 'ROOT' is not defined", please can you help me to solve it?

@vsay01
Copy link
Author

vsay01 commented Jun 1, 2021

@ezbelman
Copy link

ezbelman commented Jun 1, 2021

Thanks, i see now where is my mistake, THANKS,

i made a different code with .mount

from google.colab import drive
drive.mount("/content/drive")
df1 = pd.read_csv("drive/MyDrive/foldername/dataname.csv")
df1.head(3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment