Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
import torch
|
@@ -12,8 +13,10 @@ model_id = "runwayml/stable-diffusion-v1-5"
|
|
12 |
SAVED_CHECKPOINT = 'mikegarts/distilgpt2-lotr'
|
13 |
MIN_WORDS = 120
|
14 |
|
|
|
|
|
15 |
def get_image_pipe():
|
16 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, revision="fp16")
|
17 |
pipe.to(pipe.device)
|
18 |
return pipe
|
19 |
|
|
|
1 |
+
import os
|
2 |
import gradio as gr
|
3 |
|
4 |
import torch
|
|
|
13 |
SAVED_CHECKPOINT = 'mikegarts/distilgpt2-lotr'
|
14 |
MIN_WORDS = 120
|
15 |
|
16 |
+
READ_TOKEN = os.environ.get('HF_ACCESS_TOKEN', None)
|
17 |
+
|
18 |
def get_image_pipe():
|
19 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, revision="fp16", use_auth_token=READ_TOKEN)
|
20 |
pipe.to(pipe.device)
|
21 |
return pipe
|
22 |
|