Spaces:
Runtime error
Runtime error
zfzhang-thu
commited on
Commit
•
782b3bb
1
Parent(s):
fe2ede0
initialize cuda
Browse files- leo/inference.py +2 -2
leo/inference.py
CHANGED
@@ -166,8 +166,8 @@ def form_batch(data_dict):
|
|
166 |
|
167 |
|
168 |
def inference(scan_id, task, predict_mode=False):
|
169 |
-
|
170 |
-
device = 'cpu' # ok for predict_mode=False, and both for Gradio demo local preview
|
171 |
|
172 |
data_dict = load_data(scan_id)
|
173 |
data_dict.update(get_lang(task))
|
|
|
166 |
|
167 |
|
168 |
def inference(scan_id, task, predict_mode=False):
|
169 |
+
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
170 |
+
# device = 'cpu' # ok for predict_mode=False, and both for Gradio demo local preview
|
171 |
|
172 |
data_dict = load_data(scan_id)
|
173 |
data_dict.update(get_lang(task))
|