Nymbo commited on
Commit
707af94
1 Parent(s): 9ae8d0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -4,6 +4,9 @@ from audiosr import super_resolution, build_model
4
  import torch
5
  import gc # free up memory
6
 
 
 
 
7
 
8
  # @spaces.GPU(duration=180)
9
  def inference(audio_file, model_name, guidance_scale, ddim_steps, seed):
 
4
  import torch
5
  import gc # free up memory
6
 
7
+ torch.cuda.set_per_process_memory_fraction(0.95, 0) # This reserves 95% of GPU memory for this process
8
+ torch.backends.cuda.matmul.allow_tf32 = True # Optional: Enable TensorFloat-32 mode for efficient memory usage
9
+ torch.cuda.set_max_split_size_mb(64) # Adjust 64 MB to suit your needs based on experimentation
10
 
11
  # @spaces.GPU(duration=180)
12
  def inference(audio_file, model_name, guidance_scale, ddim_steps, seed):