Pranav Pandey commited on
Commit
8ec7f9b
1 Parent(s): 22a3fc5

Auth token added

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import streamlit as st
2
  import time
3
  import torch
 
4
  from torch import autocast
5
  from diffusers import StableDiffusionPipeline
6
  from datasets import load_dataset
@@ -22,11 +23,13 @@ seed = sl4.number_input("Enter seed", 0, 25000, 47, 1)
22
  model_id = "CompVis/stable-diffusion-v1-4"
23
  device = "cuda"
24
 
 
 
25
  pipe = StableDiffusionPipeline.from_pretrained(
26
- model_id, use_auth_token=True, revision="fp16", torch_dtype=torch.float16)
27
  pipe = pipe.to(device)
28
  word_list_dataset = load_dataset(
29
- "stabilityai/word-list", data_files="list.txt", use_auth_token=True)
30
  word_list = word_list_dataset["train"]['text']
31
 
32
 
 
1
  import streamlit as st
2
  import time
3
  import torch
4
+ import os
5
  from torch import autocast
6
  from diffusers import StableDiffusionPipeline
7
  from datasets import load_dataset
 
23
  model_id = "CompVis/stable-diffusion-v1-4"
24
  device = "cuda"
25
 
26
+ auth_token = os.environ.get("StableDiffusion") or True
27
+
28
  pipe = StableDiffusionPipeline.from_pretrained(
29
+ model_id, use_auth_token=auth_token, revision="fp16", torch_dtype=torch.float16)
30
  pipe = pipe.to(device)
31
  word_list_dataset = load_dataset(
32
+ "stabilityai/word-list", data_files="list.txt", use_auth_token=auth_token)
33
  word_list = word_list_dataset["train"]['text']
34
 
35