Omnibus commited on
Commit
f976d29
1 Parent(s): 6f1b1ff

Update dl.py

Browse files
Files changed (1) hide show
  1. dl.py +8 -9
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
- try:
276
- api = HfApi(token=token)
277
- s_ist = checklist
278
- delete_list = []
279
- for i,space_ea in enumerate(s_ist):
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
- except Exception as e:
285
- yield e
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