davanstrien HF staff commited on
Commit
7fcf86a
1 Parent(s): 2e284e5

Update upload_directory_to_hf function parameters

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -25,12 +25,12 @@ clone_into_temp_dir("https://github.com/chen-zichen/XplainLLM_dataset/")
25
  def upload_directory_to_hf(
26
  repo_id: str,
27
  directory: str,
28
- token: str,
29
  private: bool = False,
30
  ):
31
  url = create_repo(
32
  repo_id,
33
- token=token,
34
  exist_ok=True,
35
  repo_type="dataset",
36
  private=private,
@@ -41,7 +41,7 @@ def upload_directory_to_hf(
41
  path_in_repo="data",
42
  repo_id=repo_id,
43
  repo_type="dataset",
44
- token=token,
45
  commit_message="Migrated from GitHub",
46
  ignore_patterns=[
47
  "*.git*",
@@ -55,7 +55,6 @@ def upload_directory_to_hf(
55
  def push_to_hf(
56
  source_github_repository,
57
  destination_hf_hub_repository,
58
- hf_token: gr.OAuthToken,
59
  subdirectory=None,
60
  ):
61
  gr.Info("Cloning source GitHub repository...")
@@ -69,7 +68,6 @@ def push_to_hf(
69
  upload_directory_to_hf(
70
  repo_id=destination_hf_hub_repository,
71
  directory=src_directory,
72
- token=hf_token.token,
73
  private=False,
74
  )
75
  gr.Info("Syncing with Hugging Face Hub...Done")
 
25
  def upload_directory_to_hf(
26
  repo_id: str,
27
  directory: str,
28
+ hf_token: gr.OAuthToken,
29
  private: bool = False,
30
  ):
31
  url = create_repo(
32
  repo_id,
33
+ token=hf_token.token,
34
  exist_ok=True,
35
  repo_type="dataset",
36
  private=private,
 
41
  path_in_repo="data",
42
  repo_id=repo_id,
43
  repo_type="dataset",
44
+ token=hf_token.token,
45
  commit_message="Migrated from GitHub",
46
  ignore_patterns=[
47
  "*.git*",
 
55
  def push_to_hf(
56
  source_github_repository,
57
  destination_hf_hub_repository,
 
58
  subdirectory=None,
59
  ):
60
  gr.Info("Cloning source GitHub repository...")
 
68
  upload_directory_to_hf(
69
  repo_id=destination_hf_hub_repository,
70
  directory=src_directory,
 
71
  private=False,
72
  )
73
  gr.Info("Syncing with Hugging Face Hub...Done")