Hi gang,
I am trying to upload large image dataset (small images but many) via the upload_folder() function and I am getting an odd error:
from huggingface_hub import HfApi
token='mytoken'
api = HfApi(token)
#api.run_as_future(api.create_repo, "kenobi/GeneLab_BPS_BenchmarkData", exists_ok=True)
print('nothing to see here...move along...')
api.upload_folder(
folder_path="High_Energy_Ion_Fe_Nuclei",
repo_id="kenobi/GeneLab_BPS_BenchmarkData",
repo_type="dataset",
multi_commits=True,
multi_commits_verbose=True,
)
Here is the error:
Traceback (most recent call last):
File “/Users/kenobi/Desktop/upload_data.py”, line 6, in
api.upload_folder(
File “/Users/kenobi/opt/anaconda3/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py”, line 118, in _inner_fn
return fn(*args, **kwargs)
File “/Users/kenobi/opt/anaconda3/lib/python3.9/site-packages/huggingface_hub/hf_api.py”, line 1208, in _inner
return fn(self, *args, **kwargs)
File “/Users/kenobi/opt/anaconda3/lib/python3.9/site-packages/huggingface_hub/hf_api.py”, line 4583, in upload_folder
pr_url = self.create_commits_on_pr(
File “/Users/kenobi/opt/anaconda3/lib/python3.9/site-packages/huggingface_hub/utils/_experimental.py”, line 63, in _inner_fn
return fn(*args, **kwargs)
File “/Users/kenobi/opt/anaconda3/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py”, line 118, in _inner_fn
return fn(*args, **kwargs)
File “/Users/kenobi/opt/anaconda3/lib/python3.9/site-packages/huggingface_hub/hf_api.py”, line 3745, in create_commits_on_pr
for discussion in self.get_repo_discussions(repo_id=repo_id, repo_type=repo_type, token=token):
File “/Users/kenobi/opt/anaconda3/lib/python3.9/site-packages/huggingface_hub/hf_api.py”, line 5714, in get_repo_discussions
discussions, has_next = _fetch_discussion_page(page_index=page_index)
File “/Users/kenobi/opt/anaconda3/lib/python3.9/site-packages/huggingface_hub/hf_api.py”, line 5702, in _fetch_discussion_page
resp = get_session().get(path, headers=headers)
File “/Users/kenobi/opt/anaconda3/lib/python3.9/site-packages/requests/sessions.py”, line 542, in get
return self.request(‘GET’, url, **kwargs)
File “/Users/kenobi/opt/anaconda3/lib/python3.9/site-packages/requests/sessions.py”, line 515, in request
prep = self.prepare_request(req)
File “/Users/kenobi/opt/anaconda3/lib/python3.9/site-packages/requests/sessions.py”, line 443, in prepare_request
p.prepare(
File “/Users/kenobi/opt/anaconda3/lib/python3.9/site-packages/requests/models.py”, line 318, in prepare
self.prepare_url(url, params)
File “/Users/kenobi/opt/anaconda3/lib/python3.9/site-packages/requests/models.py”, line 392, in prepare_url
raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL ‘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/api/datasets/kenobi/GeneLab_BPS_BenchmarkData/discussions?page_index=0’: No scheme supplied. Perhaps you meant http://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/api/datasets/kenobi/GeneLab_BPS_BenchmarkData/discussions?page_index=0?