cocktailpeanut commited on
Commit
2effeef
1 Parent(s): b88f82b
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -13,7 +13,7 @@ from functools import partial
13
  from tsr.system import TSR
14
  from tsr.utils import remove_background, resize_foreground, to_gradio_3d_orientation
15
 
16
- HF_TOKEN = os.getenv("HF_TOKEN")
17
 
18
  HEADER = """
19
  # TripoSR Demo
@@ -56,6 +56,8 @@ HEADER = """
56
 
57
  if torch.cuda.is_available():
58
  device = "cuda:0"
 
 
59
  else:
60
  device = "cpu"
61
 
@@ -63,7 +65,7 @@ model = TSR.from_pretrained(
63
  "stabilityai/TripoSR",
64
  config_name="config.yaml",
65
  weight_name="model.ckpt",
66
- token=HF_TOKEN
67
  )
68
  model.renderer.set_chunk_size(131072)
69
  model.to(device)
 
13
  from tsr.system import TSR
14
  from tsr.utils import remove_background, resize_foreground, to_gradio_3d_orientation
15
 
16
+ #HF_TOKEN = os.getenv("HF_TOKEN")
17
 
18
  HEADER = """
19
  # TripoSR Demo
 
56
 
57
  if torch.cuda.is_available():
58
  device = "cuda:0"
59
+ elif torch.backends.mps.is_available():
60
+ device = "mps"
61
  else:
62
  device = "cpu"
63
 
 
65
  "stabilityai/TripoSR",
66
  config_name="config.yaml",
67
  weight_name="model.ckpt",
68
+ # token=HF_TOKEN
69
  )
70
  model.renderer.set_chunk_size(131072)
71
  model.to(device)