Stylique commited on
Commit
2bc2413
·
verified ·
1 Parent(s): 230724b

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -2
app.py CHANGED
@@ -21,10 +21,30 @@ if os.path.exists(packages_dir):
21
  def check_complex_dependencies():
22
  """Check if complex dependencies are available"""
23
  try:
24
- import torch_sparse
25
- import torch_scatter
26
  import nvdiffrast
27
  import pytorch3d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  return True
29
  except ImportError:
30
  return False
 
21
  def check_complex_dependencies():
22
  """Check if complex dependencies are available"""
23
  try:
 
 
24
  import nvdiffrast
25
  import pytorch3d
26
+
27
+ # Check if torch-sparse is available or disabled
28
+ try:
29
+ import torch_sparse
30
+ except ImportError:
31
+ # Check if torch-sparse was disabled
32
+ try:
33
+ with open("NeuralJacobianFields/PoissonSystem.py", 'r') as f:
34
+ content = f.read()
35
+ if "USE_TORCH_SPARSE = False" in content:
36
+ print("torch-sparse is disabled, using built-in PyTorch sparse operations")
37
+ else:
38
+ return False
39
+ except:
40
+ return False
41
+
42
+ # Check if torch-scatter is available (not critical)
43
+ try:
44
+ import torch_scatter
45
+ except ImportError:
46
+ print("torch-scatter not available, but this may not be critical")
47
+
48
  return True
49
  except ImportError:
50
  return False