Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,15 +16,24 @@ import torch
|
|
| 16 |
if not hasattr(torch, "xpu"):
|
| 17 |
class _DummyXPU:
|
| 18 |
@staticmethod
|
| 19 |
-
def empty_cache()
|
| 20 |
return None
|
| 21 |
@staticmethod
|
| 22 |
-
def
|
|
|
|
|
|
|
|
|
|
| 23 |
return False
|
| 24 |
@staticmethod
|
| 25 |
-
def device_count()
|
|
|
|
|
|
|
|
|
|
| 26 |
return 0
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
| 28 |
import time
|
| 29 |
from typing import Optional
|
| 30 |
|
|
|
|
| 16 |
if not hasattr(torch, "xpu"):
|
| 17 |
class _DummyXPU:
|
| 18 |
@staticmethod
|
| 19 |
+
def empty_cache():
|
| 20 |
return None
|
| 21 |
@staticmethod
|
| 22 |
+
def manual_seed(_seed: int):
|
| 23 |
+
return None
|
| 24 |
+
@staticmethod
|
| 25 |
+
def is_available():
|
| 26 |
return False
|
| 27 |
@staticmethod
|
| 28 |
+
def device_count():
|
| 29 |
+
return 0
|
| 30 |
+
@staticmethod
|
| 31 |
+
def current_device():
|
| 32 |
return 0
|
| 33 |
+
@staticmethod
|
| 34 |
+
def set_device(_idx: int):
|
| 35 |
+
return None
|
| 36 |
+
torch.xpu = _DummyXPU() # type: ignore
|
| 37 |
import time
|
| 38 |
from typing import Optional
|
| 39 |
|