jboth commited on
Commit
75e28bb
·
verified ·
1 Parent(s): cae3cfb

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -3,6 +3,9 @@ import os, sys, subprocess
3
  os.environ.setdefault("CUDA_HOME", "/usr/local/cuda")
4
  os.environ.setdefault("CONDA_PREFIX", "/usr/local")
5
  os.environ["LIDRA_SKIP_INIT"] = "true"
 
 
 
6
 
7
  # MUST import spaces before torch
8
  import spaces
@@ -20,7 +23,8 @@ if os.environ.get("HF_TOKEN"):
20
  STUB_KAOLIN = Path("/home/user/app/kaolin_stub")
21
  STUB_PT3D = Path("/home/user/app/pytorch3d_stub")
22
  STUB_SPCONV = Path("/home/user/app/spconv_stub")
23
- for stub in [STUB_KAOLIN, STUB_PT3D, STUB_SPCONV]:
 
24
  if stub.exists():
25
  sys.path.insert(0, str(stub))
26
  print(f"Stub added: {stub.name}")
 
3
  os.environ.setdefault("CUDA_HOME", "/usr/local/cuda")
4
  os.environ.setdefault("CONDA_PREFIX", "/usr/local")
5
  os.environ["LIDRA_SKIP_INIT"] = "true"
6
+ os.environ["ATTN_BACKEND"] = "sdpa"
7
+ os.environ["SPARSE_ATTN_BACKEND"] = "sdpa"
8
+ os.environ["SPARSE_BACKEND"] = "spconv"
9
 
10
  # MUST import spaces before torch
11
  import spaces
 
23
  STUB_KAOLIN = Path("/home/user/app/kaolin_stub")
24
  STUB_PT3D = Path("/home/user/app/pytorch3d_stub")
25
  STUB_SPCONV = Path("/home/user/app/spconv_stub")
26
+ STUB_FA = Path("/home/user/app/flash_attn_stub")
27
+ for stub in [STUB_KAOLIN, STUB_PT3D, STUB_SPCONV, STUB_FA]:
28
  if stub.exists():
29
  sys.path.insert(0, str(stub))
30
  print(f"Stub added: {stub.name}")