Muhammadreza commited on
Commit
fb04a60
1 Parent(s): a730b23

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -12
app.py CHANGED
@@ -5,18 +5,9 @@ import modin.pandas as pd
5
  import numpy as np
6
  from diffusers import DiffusionPipeline
7
 
8
- device = "cuda" if torch.cuda.is_available() else "cpu"
9
-
10
- if torch.cuda.is_available():
11
- torch.cuda.max_memory_allocated(device=device)
12
- torch.cuda.empty_cache()
13
- pipe = DiffusionPipeline.from_pretrained("mann-e/Mann-E_Dreams", torch_dtype=torch.float16)
14
- pipe.enable_xformers_memory_efficient_attention()
15
- pipe = pipe.to(device)
16
- torch.cuda.empty_cache()
17
- else:
18
- pipe = DiffusionPipeline.from_pretrained("mann-e/Mann-E_Dreams", use_safetensors=True)
19
- pipe = pipe.to(device)
20
 
21
  @spaces.GPU
22
  def genie (prompt, negative_prompt, steps, seed):
 
5
  import numpy as np
6
  from diffusers import DiffusionPipeline
7
 
8
+ pipe = DiffusionPipeline.from_pretrained("mann-e/Mann-E_Dreams", torch_dtype=torch.float16).to("cuda")
9
+ pipe.enable_xformers_memory_efficient_attention()
10
+ torch.cuda.empty_cache()
 
 
 
 
 
 
 
 
 
11
 
12
  @spaces.GPU
13
  def genie (prompt, negative_prompt, steps, seed):