try again with the patch
Browse files
app.py
CHANGED
|
@@ -11,6 +11,13 @@ def fake_device_capability():
|
|
| 11 |
return (8, 0)
|
| 12 |
def fake_current_device():
|
| 13 |
return 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
class FakeDeviceProperties:
|
| 15 |
major = 7 # Mimic a compatible GPU
|
| 16 |
minor = 5
|
|
@@ -18,7 +25,7 @@ class FakeDeviceProperties:
|
|
| 18 |
sys.modules["torch"].cuda.is_available = fake_is_available
|
| 19 |
sys.modules["torch"].cuda.get_device_capability = fake_device_capability
|
| 20 |
sys.modules["torch"].cuda.current_device = fake_current_device
|
| 21 |
-
sys.modules["torch._dynamo.device_interface"].Worker
|
| 22 |
|
| 23 |
import streamlit as st
|
| 24 |
from unsloth.chat_templates import get_chat_template, CHAT_TEMPLATES
|
|
|
|
| 11 |
return (8, 0)
|
| 12 |
def fake_current_device():
|
| 13 |
return 0
|
| 14 |
+
|
| 15 |
+
class Worker:
|
| 16 |
+
def __init__(self):
|
| 17 |
+
pass
|
| 18 |
+
|
| 19 |
+
def get_device_properties(self):
|
| 20 |
+
return FakeDeviceProperties()
|
| 21 |
class FakeDeviceProperties:
|
| 22 |
major = 7 # Mimic a compatible GPU
|
| 23 |
minor = 5
|
|
|
|
| 25 |
sys.modules["torch"].cuda.is_available = fake_is_available
|
| 26 |
sys.modules["torch"].cuda.get_device_capability = fake_device_capability
|
| 27 |
sys.modules["torch"].cuda.current_device = fake_current_device
|
| 28 |
+
sys.modules["torch._dynamo.device_interface"].Worker = Worker()
|
| 29 |
|
| 30 |
import streamlit as st
|
| 31 |
from unsloth.chat_templates import get_chat_template, CHAT_TEMPLATES
|