bingyic commited on
Commit
f8fe515
·
1 Parent(s): 3e1b5c2

Fix: Use HF_TOKEN to access private models

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,6 +1,7 @@
1
  """TIPS Feature Explorer (GPU) — Hugging Face Space demo with ZeroGPU."""
2
 
3
  import colorsys
 
4
 
5
  import gradio as gr
6
  import matplotlib.cm as cm
@@ -293,7 +294,7 @@ def load_variant(name):
293
  global _model
294
  if _model["name"] == name:
295
  return
296
- dpt = AutoModel.from_pretrained(VARIANTS[name], trust_remote_code=True)
297
  dpt.eval()
298
  dpt._get_backbone() # trigger backbone download
299
  backbone = dpt._backbone
 
1
  """TIPS Feature Explorer (GPU) — Hugging Face Space demo with ZeroGPU."""
2
 
3
  import colorsys
4
+ import os
5
 
6
  import gradio as gr
7
  import matplotlib.cm as cm
 
294
  global _model
295
  if _model["name"] == name:
296
  return
297
+ dpt = AutoModel.from_pretrained(VARIANTS[name], trust_remote_code=True, token=os.environ.get("HF_TOKEN"))
298
  dpt.eval()
299
  dpt._get_backbone() # trigger backbone download
300
  backbone = dpt._backbone