Spaces:
Runtime error
Runtime error
Add auth token for diffusion model download.
Browse files
app.py
CHANGED
|
@@ -21,6 +21,9 @@ from diffusers import DiffusionPipeline, EulerAncestralDiscreteScheduler
|
|
| 21 |
# https://docs.fast.ai/learner.html#load_learner
|
| 22 |
from transformers import GPT2TokenizerFast
|
| 23 |
|
|
|
|
|
|
|
|
|
|
| 24 |
# update requirements.txt with:
|
| 25 |
# C:\Users\Grant\PycharmProjects\test_space\venv\Scripts\pip3.exe freeze > requirements.txt
|
| 26 |
|
|
@@ -59,7 +62,7 @@ class DropOutput(Callback):
|
|
| 59 |
# is_mega=True,
|
| 60 |
# is_reusable=True
|
| 61 |
# )
|
| 62 |
-
pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", custom_pipeline="stable_diffusion_mega", torch_dtype=torch.float16, revision="fp16")
|
| 63 |
|
| 64 |
# pipeline.to("cuda")
|
| 65 |
|
|
|
|
| 21 |
# https://docs.fast.ai/learner.html#load_learner
|
| 22 |
from transformers import GPT2TokenizerFast
|
| 23 |
|
| 24 |
+
import os
|
| 25 |
+
AUTH_TOKEN = os.environ.get('AUTH_TOKEN')
|
| 26 |
+
|
| 27 |
# update requirements.txt with:
|
| 28 |
# C:\Users\Grant\PycharmProjects\test_space\venv\Scripts\pip3.exe freeze > requirements.txt
|
| 29 |
|
|
|
|
| 62 |
# is_mega=True,
|
| 63 |
# is_reusable=True
|
| 64 |
# )
|
| 65 |
+
pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", custom_pipeline="stable_diffusion_mega", torch_dtype=torch.float16, revision="fp16", use_auth_token=AUTH_TOKEN)
|
| 66 |
|
| 67 |
# pipeline.to("cuda")
|
| 68 |
|