Spaces:
Runtime error
Runtime error
Benjamin G
commited on
Commit
·
996c7bc
1
Parent(s):
0439661
fix gpu
Browse files
app.py
CHANGED
|
@@ -8,8 +8,7 @@ from transformers import (
|
|
| 8 |
from threading import Thread
|
| 9 |
import gradio as gr
|
| 10 |
|
| 11 |
-
|
| 12 |
-
has_gpu = False
|
| 13 |
device = "cuda" if has_gpu else "cpu"
|
| 14 |
|
| 15 |
torch.set_default_device(device)
|
|
|
|
| 8 |
from threading import Thread
|
| 9 |
import gradio as gr
|
| 10 |
|
| 11 |
+
has_gpu = torch.cuda.is_available()
|
|
|
|
| 12 |
device = "cuda" if has_gpu else "cpu"
|
| 13 |
|
| 14 |
torch.set_default_device(device)
|