alexktrs commited on
Commit
0015a1e
·
1 Parent(s): 292cac0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -1,8 +1,13 @@
1
  import gradio as gr
2
  from diffusers import DDPMPipeline
 
3
 
4
  model = 'alexktrs/CumulusCloudsGenerator'
5
- device='cuda'
 
 
 
 
6
 
7
  generator = DDPMPipeline.from_pretrained(model)
8
  generator.to(device)
 
1
  import gradio as gr
2
  from diffusers import DDPMPipeline
3
+ import torch
4
 
5
  model = 'alexktrs/CumulusCloudsGenerator'
6
+
7
+ if torch.cuda.is_available():
8
+ device='cuda'
9
+ else:
10
+ device='cpu'
11
 
12
  generator = DDPMPipeline.from_pretrained(model)
13
  generator.to(device)