DemiPoto commited on
Commit
c8ec31e
1 Parent(s): cdbdf7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -322,9 +322,11 @@ def reset_cache_image(id,cache_image=cache_image):
322
  def reset_cache_image_actu(id,cache_image_actu=cache_image_actu):
323
  cache_image_actu[f"{id}"].clear()
324
  return
325
- def reset_cache_image_all_sessions(cache_image=cache_image):
326
  for key, listT in cache_image.items():
327
  listT.clear()
 
 
328
  return
329
 
330
  def set_session(id):
@@ -337,11 +339,13 @@ def set_session(id):
337
  return id
338
  def print_info_sessions():
339
  lenTot=0
340
- print("numbre of sessions : "+str(len(cache_image)))
 
341
  for key, listT in cache_image.items():
342
- print(key+str(len(listT)))
343
  lenTot+=len(listT)
344
  print("images total = "+str(lenTot))
 
345
  return
346
 
347
  def disp_models(group_model_choice,nb_rep=nb_rep):
@@ -495,7 +499,7 @@ def make_me():
495
  o.change(add_cache_image,[o,m,id_session],[])
496
  o.change(add_cache_image_actu,[o,m,id_session],[])
497
  gen_button.click(reset_cache_image_actu, [id_session], [])
498
- gen_button.click(lambda id:gr.Button('Load Galerry All ('+str(len(cache_image_actu[f"{id}"]))+")"), [id_session], [b12])
499
 
500
  with gr.Group():
501
  with gr.Row():
 
322
  def reset_cache_image_actu(id,cache_image_actu=cache_image_actu):
323
  cache_image_actu[f"{id}"].clear()
324
  return
325
+ def reset_cache_image_all_sessions(cache_image=cache_image,cache_image_actu=cache_image_actu):
326
  for key, listT in cache_image.items():
327
  listT.clear()
328
+ for key, listT in cache_image_actu.items():
329
+ listT.clear()
330
  return
331
 
332
  def set_session(id):
 
339
  return id
340
  def print_info_sessions():
341
  lenTot=0
342
+ print("###################################")
343
+ print("number of sessions : "+str(len(cache_image)))
344
  for key, listT in cache_image.items():
345
+ print("session "+key+" : "+str(len(listT)))
346
  lenTot+=len(listT)
347
  print("images total = "+str(lenTot))
348
+ print("###################################")
349
  return
350
 
351
  def disp_models(group_model_choice,nb_rep=nb_rep):
 
499
  o.change(add_cache_image,[o,m,id_session],[])
500
  o.change(add_cache_image_actu,[o,m,id_session],[])
501
  gen_button.click(reset_cache_image_actu, [id_session], [])
502
+ gen_button.click(lambda id:gr.Button('Load Galerry All ('+str(len(cache_image[f"{id}"]))+")"), [id_session], [b12])
503
 
504
  with gr.Group():
505
  with gr.Row():