Ani14 commited on
Commit
1738f9f
·
verified ·
1 Parent(s): a83e7cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -16,15 +16,24 @@ import torch
16
  if not hasattr(torch, "xpu"):
17
  class _DummyXPU:
18
  @staticmethod
19
- def empty_cache() -> None:
20
  return None
21
  @staticmethod
22
- def is_available() -> bool:
 
 
 
23
  return False
24
  @staticmethod
25
- def device_count() -> int:
 
 
 
26
  return 0
27
- torch.xpu = _DummyXPU() # type: ignore[attr-defined]
 
 
 
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