Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -56,6 +56,10 @@ def infer(
|
|
| 56 |
|
| 57 |
global pipe, current_model_id
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
# reload pipeline if user picked a different model
|
| 60 |
if model_name != current_model_id:
|
| 61 |
pipe = DiffusionPipeline.from_pretrained(
|
|
|
|
| 56 |
|
| 57 |
global pipe, current_model_id
|
| 58 |
|
| 59 |
+
hf_token = os.getenv("HF_TOKEN_SPACES")
|
| 60 |
+
if hf_token is None:
|
| 61 |
+
raise RuntimeError("HF_TOKEN_SPACES is not available inside GPU worker.")
|
| 62 |
+
|
| 63 |
# reload pipeline if user picked a different model
|
| 64 |
if model_name != current_model_id:
|
| 65 |
pipe = DiffusionPipeline.from_pretrained(
|