dailingx commited on
Commit
2909383
1 Parent(s): 30b238e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -18
app.py CHANGED
@@ -9,8 +9,8 @@ import gradio as gr
9
 
10
  CACHE_DIR = "hf2ms_cache"
11
  LOCAL_DIR = "hf2ms_local"
12
- USERNAME = "heatingma"
13
- EMAIL = "heatingma@sjtu.edu.cn"
14
 
15
 
16
  def clone_from_ms(
@@ -174,22 +174,16 @@ def handle(
174
  clone_dir = ms_repo.split("/")[-1]
175
  hf_file_list = hf_list_repo_files(hf_token, hf_repo, repo_type)
176
  print(f"all file in hf: {hf_file_list}")
177
- # file_paths = []
178
- # for idx in range(100):
179
- # begin_idx = idx * 100
180
- # end_idx = begin_idx + 100
181
- # file_path = f"panda_011_{begin_idx:06d}_{end_idx:06d}.tar.gz"
182
- # file_paths.append(file_path)
183
-
184
- # for filename in file_paths:
185
- # clone_from_ms(ms_token, ms_repo, clone_dir)
186
- # time.sleep(1)
187
- # pull_from_hf(hf_token, hf_repo, filename)
188
- # time.sleep(1)
189
- # move_file_from_local_to_clone_dir(filename, clone_dir)
190
- # time.sleep(1)
191
- # push_to_ms(USERNAME, EMAIL, ms_repo, clone_dir, filename)
192
- # time.sleep(10)
193
 
194
 
195
  with gr.Blocks() as demo:
 
9
 
10
  CACHE_DIR = "hf2ms_cache"
11
  LOCAL_DIR = "hf2ms_local"
12
+ USERNAME = "dailingx"
13
+ EMAIL = "468551414@qq.com"
14
 
15
 
16
  def clone_from_ms(
 
174
  clone_dir = ms_repo.split("/")[-1]
175
  hf_file_list = hf_list_repo_files(hf_token, hf_repo, repo_type)
176
  print(f"all file in hf: {hf_file_list}")
177
+
178
+ for filename in hf_file_list:
179
+ clone_from_ms(ms_token, ms_repo, clone_dir)
180
+ time.sleep(1)
181
+ pull_from_hf(hf_token, hf_repo, filename)
182
+ time.sleep(1)
183
+ move_file_from_local_to_clone_dir(filename, clone_dir)
184
+ time.sleep(1)
185
+ push_to_ms(USERNAME, EMAIL, ms_repo, clone_dir, filename)
186
+ time.sleep(10)
 
 
 
 
 
 
187
 
188
 
189
  with gr.Blocks() as demo: