Spaces:
Sleeping
Sleeping
chenlei1983
commited on
Commit
•
328ca09
1
Parent(s):
cdc3a53
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ def push_to_hf(cache_dir, WiseModel_repo_name, hf_repo_id):
|
|
60 |
return f'Pushed to {hf_repo_id}'
|
61 |
|
62 |
|
63 |
-
def handle(
|
64 |
cache_dir = get_cache_dir()
|
65 |
wiseModel_repo_url=wisemodel_link.replace(".git","").replace("git","").replace("clone","").replace(" ","")
|
66 |
wiseModel_repo_info=wisemodel_link.replace(".git","").replace("git","").replace("clone","").replace(" ","").split("/")
|
@@ -70,7 +70,7 @@ def handle(wisemodel_token,wisemodel_link, hf_repo_id):
|
|
70 |
(check_disk, (), {}),
|
71 |
# # Run all the sanity checks on README.md
|
72 |
|
73 |
-
(pull_from_wisemodel, (
|
74 |
(remove_file, (wisemodel_repo_name, cache_dir), {}),
|
75 |
(check_disk, (), {}),
|
76 |
(push_to_hf, (cache_dir, wisemodel_repo_name, hf_repo_id), {}),
|
@@ -112,7 +112,7 @@ This space uploads model from WiseModel to Huggingface.
|
|
112 |
error = gr.Textbox(label="Error")
|
113 |
output = gr.Textbox(label="Output")
|
114 |
|
115 |
-
button.click(handle, [
|
116 |
|
117 |
if __name__ == "__main__":
|
118 |
demo.launch(debug = True)
|
|
|
60 |
return f'Pushed to {hf_repo_id}'
|
61 |
|
62 |
|
63 |
+
def handle(wisemodel_link, hf_repo_id):
|
64 |
cache_dir = get_cache_dir()
|
65 |
wiseModel_repo_url=wisemodel_link.replace(".git","").replace("git","").replace("clone","").replace(" ","")
|
66 |
wiseModel_repo_info=wisemodel_link.replace(".git","").replace("git","").replace("clone","").replace(" ","").split("/")
|
|
|
70 |
(check_disk, (), {}),
|
71 |
# # Run all the sanity checks on README.md
|
72 |
|
73 |
+
(pull_from_wisemodel, (WiseModel_TOKEN,wiseModel_repo_url,wisemodel_repo_name, cache_dir,"main"), {}),
|
74 |
(remove_file, (wisemodel_repo_name, cache_dir), {}),
|
75 |
(check_disk, (), {}),
|
76 |
(push_to_hf, (cache_dir, wisemodel_repo_name, hf_repo_id), {}),
|
|
|
112 |
error = gr.Textbox(label="Error")
|
113 |
output = gr.Textbox(label="Output")
|
114 |
|
115 |
+
button.click(handle, [wisemodel_link, hf_repo_id], [output, error])
|
116 |
|
117 |
if __name__ == "__main__":
|
118 |
demo.launch(debug = True)
|