AlexWortega commited on
Commit
36ab2ee
1 Parent(s): 8be1a0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -3,8 +3,8 @@ import gradio as gr
3
  import torch
4
  from torch import autocast
5
  from kandinsky2 import get_kandinsky2
6
-
7
- model = get_kandinsky2('cuda', task_type='text2img')
8
 
9
 
10
 
 
3
  import torch
4
  from torch import autocast
5
  from kandinsky2 import get_kandinsky2
6
+ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
7
+ model = get_kandinsky2(device, task_type='text2img')
8
 
9
 
10