Import spaces before tribev2 to avoid CUDA init order error
Browse filesCo-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
app.py
CHANGED
|
@@ -1,9 +1,3 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
import numpy as np
|
| 3 |
-
import plotly.graph_objects as go
|
| 4 |
-
import threading
|
| 5 |
-
from tribev2 import TribeModel
|
| 6 |
-
|
| 7 |
try:
|
| 8 |
import spaces
|
| 9 |
except ImportError:
|
|
@@ -13,6 +7,12 @@ except ImportError:
|
|
| 13 |
return dec
|
| 14 |
spaces = _Placeholder()
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
# ββ Load model (thread-safe, lazy) ββββββββββββββββββββββββββββββββββββββββββ
|
| 17 |
|
| 18 |
_model = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
try:
|
| 2 |
import spaces
|
| 3 |
except ImportError:
|
|
|
|
| 7 |
return dec
|
| 8 |
spaces = _Placeholder()
|
| 9 |
|
| 10 |
+
import gradio as gr
|
| 11 |
+
import numpy as np
|
| 12 |
+
import plotly.graph_objects as go
|
| 13 |
+
import threading
|
| 14 |
+
from tribev2 import TribeModel
|
| 15 |
+
|
| 16 |
# ββ Load model (thread-safe, lazy) ββββββββββββββββββββββββββββββββββββββββββ
|
| 17 |
|
| 18 |
_model = None
|