bupa1018 commited on
Commit
e70b26d
·
1 Parent(s): fc98e50

Update download_repo_to_huggingface.py

Browse files
Files changed (1) hide show
  1. download_repo_to_huggingface.py +2 -2
download_repo_to_huggingface.py CHANGED
@@ -14,7 +14,7 @@ def download_and_upload_kadiAPY_repo_to_huggingfacespace(api_url, project_id, ve
14
  response = requests.get(url, stream=True)
15
 
16
  if response.status_code == 200:
17
- extract_and_upload_file(response, api, DATA_DIR, HF_SPACE_NAME)
18
  else:
19
  print(f"Failed to download the release: {response.status_code} - {response.reason}")
20
  print(response.text)
@@ -27,7 +27,7 @@ def download_and_upload_kadiAPY_repo_to_huggingfacespace(api_url, project_id, ve
27
  print(f"An error occurred: {e}")
28
 
29
 
30
- def extract_and_upload_file(response, api, DATA_DIR, HF_SPACE_NAME):
31
  """Extracts the archive content and uploads the file."""
32
  archive_bytes = io.BytesIO(response.content)
33
  # Extract filename from content-disposition header
 
14
  response = requests.get(url, stream=True)
15
 
16
  if response.status_code == 200:
17
+ _extract_and_upload_file(response, api, DATA_DIR, HF_SPACE_NAME)
18
  else:
19
  print(f"Failed to download the release: {response.status_code} - {response.reason}")
20
  print(response.text)
 
27
  print(f"An error occurred: {e}")
28
 
29
 
30
+ def _extract_and_upload_file(response, api, DATA_DIR, HF_SPACE_NAME):
31
  """Extracts the archive content and uploads the file."""
32
  archive_bytes = io.BytesIO(response.content)
33
  # Extract filename from content-disposition header