John6666 commited on
Commit
ea8d413
1 Parent(s): 58b5551

Upload 2 files

Browse files
Files changed (1) hide show
  1. mod.py +8 -4
mod.py CHANGED
@@ -74,10 +74,13 @@ def is_repo_exists(repo_id):
74
 
75
 
76
  def clear_cache():
77
- torch.cuda.empty_cache()
78
- torch.cuda.reset_max_memory_allocated()
79
- torch.cuda.reset_peak_memory_stats()
80
- gc.collect()
 
 
 
81
 
82
 
83
  def deselect_lora():
@@ -348,3 +351,4 @@ load_prompt_enhancer.zerogpu = True
348
  fuse_loras.zerogpu = True
349
  preprocess_image.zerogpu = True
350
  get_control_params.zerogpu = True
 
 
74
 
75
 
76
  def clear_cache():
77
+ try:
78
+ torch.cuda.empty_cache()
79
+ torch.cuda.reset_max_memory_allocated()
80
+ torch.cuda.reset_peak_memory_stats()
81
+ gc.collect()
82
+ except Exception as e:
83
+ print(e)
84
 
85
 
86
  def deselect_lora():
 
351
  fuse_loras.zerogpu = True
352
  preprocess_image.zerogpu = True
353
  get_control_params.zerogpu = True
354
+ clear_cache.zerogpu = True