Update app.py
Browse files
app.py
CHANGED
|
@@ -88,7 +88,7 @@ def delete_repo(token, repo_id, repo_type):
|
|
| 88 |
api = get_hf_api(token)
|
| 89 |
api.delete_repo(repo_id=repo_id, repo_type=repo_type)
|
| 90 |
gr.Info(f"Successfully deleted '{repo_id}'.")
|
| 91 |
-
return
|
| 92 |
except HfHubHTTPError as e:
|
| 93 |
gr.Error(f"Failed to delete repository: {e}")
|
| 94 |
return repo_id, gr.update(visible=True), gr.update(visible=False)
|
|
@@ -106,7 +106,7 @@ def archive_repo(token, repo_id, archive_repo):
|
|
| 106 |
archive_space=f'{archive_repo}/{repo_id.split("/")[1]}'
|
| 107 |
api.move_repo(repo_id=repo_id, archive_space=archive_space)
|
| 108 |
gr.Info(f"Successfully moved to '{archive_space}'.")
|
| 109 |
-
return
|
| 110 |
except HfHubHTTPError as e:
|
| 111 |
gr.Error(f"Failed to archive repository: {e}")
|
| 112 |
return repo_id, gr.update(visible=True), gr.update(visible=False)
|
|
|
|
| 88 |
api = get_hf_api(token)
|
| 89 |
api.delete_repo(repo_id=repo_id, repo_type=repo_type)
|
| 90 |
gr.Info(f"Successfully deleted '{repo_id}'.")
|
| 91 |
+
return gr.update(), gr.update(visible=False), gr.update(visible=False)
|
| 92 |
except HfHubHTTPError as e:
|
| 93 |
gr.Error(f"Failed to delete repository: {e}")
|
| 94 |
return repo_id, gr.update(visible=True), gr.update(visible=False)
|
|
|
|
| 106 |
archive_space=f'{archive_repo}/{repo_id.split("/")[1]}'
|
| 107 |
api.move_repo(repo_id=repo_id, archive_space=archive_space)
|
| 108 |
gr.Info(f"Successfully moved to '{archive_space}'.")
|
| 109 |
+
return gr.update(), gr.update(visible=False), gr.update(visible=False)
|
| 110 |
except HfHubHTTPError as e:
|
| 111 |
gr.Error(f"Failed to archive repository: {e}")
|
| 112 |
return repo_id, gr.update(visible=True), gr.update(visible=False)
|