akhaliq HF Staff commited on
Commit
39a27c3
·
1 Parent(s): 571de6e

Drop HF_TOKEN requirement; model repos are public now

Browse files
Files changed (1) hide show
  1. app.py +2 -10
app.py CHANGED
@@ -40,16 +40,8 @@ PE_I2I_ID = "Qwen/Qwen-Image-2.1-PE-I2I"
40
  GUARD_ID = "hfmlsoc/ncii-guard-v02"
41
  GUARD_THRESHOLD = 0.5
42
 
43
- # The model repo is private/gated. Per the Hub auth docs, the HF_TOKEN
44
- # environment variable is used implicitly for all Hub requests and takes
45
- # priority over any stored token — so set HF_TOKEN as a Space secret
46
- # (Settings -> Secrets) with a token whose account has access to the repo.
47
- if not os.environ.get("HF_TOKEN"):
48
- raise RuntimeError(
49
- "HF_TOKEN is not set. Add it as a Space secret (Settings -> Secrets) "
50
- f"with read access to {MODEL_ID}."
51
- )
52
-
53
  pipe = QwenImage21Pipeline.from_pretrained(MODEL_ID, dtype=torch.bfloat16)
54
  pipe.to("cuda")
55
 
 
40
  GUARD_ID = "hfmlsoc/ncii-guard-v02"
41
  GUARD_THRESHOLD = 0.5
42
 
43
+ # All model repos are public. If HF_TOKEN is set as a Space secret it is used
44
+ # implicitly for Hub requests (higher rate limits), but it is not required.
 
 
 
 
 
 
 
 
45
  pipe = QwenImage21Pipeline.from_pretrained(MODEL_ID, dtype=torch.bfloat16)
46
  pipe.to("cuda")
47