Manjushri commited on
Commit
65928e5
·
verified ·
1 Parent(s): 893441b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -34,6 +34,8 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed):
34
  return image
35
 
36
  if Model == "Club":
 
 
37
  pipe = CogView4Pipeline.from_pretrained("THUDM/CogView4-6B", torch_dtype=torch.bfloat16)
38
  # Open it for reduce GPU memory usage
39
  pipe.enable_model_cpu_offload()
 
34
  return image
35
 
36
  if Model == "Club":
37
+ torch.cuda.max_memory_allocated(device=device)
38
+ torch.cuda.empty_cache()
39
  pipe = CogView4Pipeline.from_pretrained("THUDM/CogView4-6B", torch_dtype=torch.bfloat16)
40
  # Open it for reduce GPU memory usage
41
  pipe.enable_model_cpu_offload()