Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import spaces
|
| 2 |
import torch
|
| 3 |
import gradio as gr
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
@spaces.GPU(duration=30)
|
| 8 |
def probe():
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
# torch_geometric / pyg-lib can call cuInit at import; try to suppress.
|
| 3 |
+
os.environ.setdefault("TORCH_GEOMETRIC_DISABLE_EXTENSIONS", "1")
|
| 4 |
import spaces
|
| 5 |
import torch
|
| 6 |
import gradio as gr
|
| 7 |
+
try:
|
| 8 |
+
import torch_geometric # noqa -- test pyg alone
|
| 9 |
+
_pyg = torch_geometric.__version__
|
| 10 |
+
except Exception as e:
|
| 11 |
+
_pyg = f"import-failed: {e!r}"
|
| 12 |
+
print("PROBE_MARK pyg", _pyg, "cuda_init_parent=", torch.cuda.is_initialized(), flush=True)
|
| 13 |
|
| 14 |
@spaces.GPU(duration=30)
|
| 15 |
def probe():
|