broadfield-dev commited on
Commit
755028e
·
verified ·
1 Parent(s): d5fb3f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -263,6 +263,19 @@ def agent(prompt_in,history,mod=2,tok_in=""):
263
  print('file list\n',file_read)
264
  history+=[{'role':'system','content':f'RETURNED FILE CONTENT: NAME: spaces/{user_}{repo_}/{com} CONTENT:{file_read}'}]
265
  yield history
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  elif 'IMAGE' in fn:
267
  print('IMAGE called')
268
  #out_im=gen_im(prompt,seed)
 
263
  print('file list\n',file_read)
264
  history+=[{'role':'system','content':f'RETURNED FILE CONTENT: NAME: spaces/{user_}{repo_}/{com} CONTENT:{file_read}'}]
265
  yield history
266
+
267
+ elif 'DELETE_FILE' in fn:
268
+ try:
269
+ fs.rm(f'spaces/{user_}{repo_}/{com.strip("./")}',detail=False)
270
+ file_del="SUCCESS"
271
+ except Exception as e:
272
+ print(e)
273
+ file_del="FAILED"
274
+ #print('file list\n',file_read)
275
+ history+=[{'role':'system','content':f'REMOVING FILE:\n NAME: spaces/{user_}{repo_}/{com} \n STATUS: {file_del}'}]
276
+ yield history
277
+
278
+
279
  elif 'IMAGE' in fn:
280
  print('IMAGE called')
281
  #out_im=gen_im(prompt,seed)