cwenger commited on
Commit
31eb4a6
·
verified ·
1 Parent(s): 0366bb6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -6,11 +6,11 @@ import numpy as np
6
  import gradio as gr
7
 
8
  def _grab_best_device(use_gpu=True):
9
- #if torch.cuda.device_count() > 0 and use_gpu:
10
- # device = "cuda"
11
- #else:
12
- # device = "cpu"
13
- device = 0 if torch.cuda.is_available() else -1
14
 
15
  return device
16
 
 
6
  import gradio as gr
7
 
8
  def _grab_best_device(use_gpu=True):
9
+ if torch.cuda.device_count() > 0 and use_gpu:
10
+ device = 0 #"cuda"
11
+ else:
12
+ device = -1 #"cpu"
13
+ #device = 0 if torch.cuda.is_available() else -1
14
 
15
  return device
16