Spaces:
Running
Running
Update dl.py
Browse files
dl.py
CHANGED
@@ -272,17 +272,16 @@ def get_space_runtime(author,checklist,token):
|
|
272 |
return space_info
|
273 |
def delete_checked(confirm_val,author,checklist,token):
|
274 |
if confirm_val=="CONFIRM":
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
api.delete_repo(f'{author}/{space_ea}')
|
282 |
delete_list.append(f'Deleted:: {space_ea}\n')
|
283 |
yield delete_list,gr.update(visible=False)
|
284 |
-
|
285 |
-
|
286 |
else:
|
287 |
yield "Not Deleting", gr.update(visible=False)
|
288 |
|
|
|
272 |
return space_info
|
273 |
def delete_checked(confirm_val,author,checklist,token):
|
274 |
if confirm_val=="CONFIRM":
|
275 |
+
api = HfApi(token=token)
|
276 |
+
s_ist = checklist
|
277 |
+
delete_list = []
|
278 |
+
for i,space_ea in enumerate(s_ist):
|
279 |
+
try:
|
280 |
+
api.delete_repo(repo_id=f'{author}/{space_ea}',repo_type='space')
|
|
|
281 |
delete_list.append(f'Deleted:: {space_ea}\n')
|
282 |
yield delete_list,gr.update(visible=False)
|
283 |
+
except Exception as e:
|
284 |
+
yield e
|
285 |
else:
|
286 |
yield "Not Deleting", gr.update(visible=False)
|
287 |
|