multimodalart HF Staff commited on
Commit
216e5d3
·
verified ·
1 Parent(s): 0bf77c9

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -1,8 +1,15 @@
 
 
 
1
  import spaces
2
  import torch
3
  import gradio as gr
4
- import transformers # noqa -- test transformers alone
5
- print("PROBE_MARK transformers", transformers.__version__, "cuda_init_parent=", torch.cuda.is_initialized(), flush=True)
 
 
 
 
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():