Shaleen123 commited on
Commit
5bd8db4
·
verified ·
1 Parent(s): 50d0dca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -14,14 +14,8 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
14
  # # notebook_login(token_key)
15
 
16
  @spaces.GPU
17
- if torch.cuda.is_available():
18
- torch.cuda.max_memory_allocated(device=device)
19
- pipe = AutoPipelineForText2Image.from_pretrained("Shaleen123/kandinsky_2.5", torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
20
- pipe.enable_xformers_memory_efficient_attention()
21
- pipe = pipe.to(device)
22
- else:
23
- pipe = AutoPipelineForText2Image.from_pretrained("Shaleen123/kandinsky_2.5", use_safetensors=True)
24
- pipe = pipe.to(device)
25
 
26
  MAX_SEED = np.iinfo(np.int32).max
27
  MAX_IMAGE_SIZE = 1024
 
14
  # # notebook_login(token_key)
15
 
16
  @spaces.GPU
17
+ pipe = AutoPipelineForText2Image.from_pretrained("Shaleen123/kandinsky_2.5", torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
18
+ pipe.enable_xformers_memory_efficient_attention()
 
 
 
 
 
 
19
 
20
  MAX_SEED = np.iinfo(np.int32).max
21
  MAX_IMAGE_SIZE = 1024