tellurion Claude Sonnet 4.6 commited on
Commit
f35094d
·
1 Parent(s): 115b3c7

Add HF_TOKEN auth for private model repo access

Browse files

Login to HuggingFace Hub using HF_TOKEN env var (set as Space secret).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. backend/appfunc.py +5 -1
backend/appfunc.py CHANGED
@@ -4,7 +4,11 @@ import traceback
4
  import gradio as gr
5
  import os.path as osp
6
 
7
- from huggingface_hub import hf_hub_download, list_repo_files
 
 
 
 
8
 
9
  from omegaconf import OmegaConf
10
  from refnet.util import instantiate_from_config
 
4
  import gradio as gr
5
  import os.path as osp
6
 
7
+ from huggingface_hub import hf_hub_download, list_repo_files, login
8
+
9
+ HF_TOKEN = os.environ.get("HF_TOKEN", None)
10
+ if HF_TOKEN:
11
+ login(token=HF_TOKEN)
12
 
13
  from omegaconf import OmegaConf
14
  from refnet.util import instantiate_from_config