Spaces:
Running on Zero
Running on Zero
Drop HF_TOKEN requirement; model repos are public now
Browse files
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 |
-
#
|
| 44 |
-
#
|
| 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 |
|