Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,8 @@ import gradio as gr
|
|
9 |
|
10 |
CACHE_DIR = "hf2ms_cache"
|
11 |
LOCAL_DIR = "hf2ms_local"
|
12 |
-
USERNAME = "
|
13 |
-
EMAIL = "
|
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 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
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:
|