How do I import zip files from HF to colab

I am trying to import my data to DFL_Colab. I extracted and cleaned up the data when I attempted to use DFL locally then I uploaded the data to HF. I dont know how any of this works so I tried copying and pasting a number of things.
Notebook Link
Cell code:

`#@title Import from URL{ form-width: “30%”, display->mode: “form” }
URL = >“https://huggingface.co/NexViolentus/MyStuff/blob/main/>data_dst.zip” #@param {type:“string”}
Mode = “unzip to content” #@param [“unzip to content”, “unzip to content/workspace”, “unzip to content/workspace/data_src”, “unzip to content/workspace/data_src/aligned”, “unzip to content/workspace/data_dst”, “unzip to content/workspace/data_dst/aligned”, “unzip to content/workspace/model”, “download to content/workspace”]

import urllib.request
from pathlib import Path

def unzip(zip_path, dest_path):

unzip_cmd = " unzip -q " + zip_path + " -d "+dest_path
!$unzip_cmd
rm_cmd = "rm "+dest_path + url_path.name
!$rm_cmd
print(“Unziped!”)

if Mode == “unzip to content”:
dest_path = “/content/”
elif Mode == “unzip to content/workspace”:
dest_path = “/content/workspace/”
elif Mode == “unzip to content/workspace/data_src”:
dest_path = “/content/workspace/data_src/”
elif Mode == “unzip to content/workspace/data_src/aligned”:
dest_path = “/content/workspace/data_src/aligned/”
elif Mode == “unzip to content/workspace/data_dst”:
dest_path = “/content/workspace/data_dst/”
elif Mode == “unzip to content/workspace/data_dst/aligned”:
dest_path = “/content/workspace/data_dst/aligned/”
elif Mode == “unzip to content/workspace/model”:
dest_path = “/content/workspace/model/”
elif Mode == “download to content/workspace”:
dest_path = “/content/workspace/”

if not Path(“/content/workspace”).exists():
cmd = “mkdir /content/workspace; mkdir /content/workspace/data_src; mkdir /content/workspace/data_src/aligned; mkdir /content/workspace/data_dst; mkdir /content/workspace/data_dst/aligned; mkdir /content/workspace/model”
!$cmd

url_path = Path(URL)
urllib.request.urlretrieve ( URL, dest_path + url_path.name )

if (url_path.suffix == “.zip”) and (Mode!=“download to content/workspace”):
unzip(dest_path + url_path.name, dest_path)

print(“Done!”)`

‘I get some variation of the errors below. I tried usermane:password@url, making it public, installing transformers. If this doesnt work on colab at all is there another notebook I could use?’

Errors:

'HTTPError Traceback (most recent call last)
in <cell line: 40>()
38
39 url_path = Path(URL)
—> 40 urllib.request.urlretrieve ( URL, dest_path + url_path.name )
41
42 if (url_path.suffix == “.zip”) and (Mode!=“download to content/workspace”):

6 frames
/usr/lib/python3.10/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
641 class HTTPDefaultErrorHandler(BaseHandler):
642 def http_error_default(self, req, fp, code, msg, hdrs):
→ 643 raise HTTPError(req.full_url, code, msg, hdrs, fp)
644
645 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 401: Unauthorized’

if anyone is googling this here is what worked for me

!pip install huggingface_hub
from huggingface_hub import hf_hub_download
from huggingface_hub import login

login(token=“hf_yourtoken”)
hf_hub_download(repo_id=“username/repository”,
filename=“data_src.zip”)

#import the file or repository
!git clone http://huggingface.co/username/repository

#this converts the zip to a usable format

!zip -FF path/to/zipfile --output path/to/output/zip

#unzip the file
!unzip path/to/your/zip