tombetthauser commited on
Commit
7332a57
Β·
1 Parent(s): 552308c

Update app.py

Browse files

Attempt new login syntax using env key

Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -85,7 +85,14 @@ api = HfApi()
85
  models_list = api.list_models(author="sd-concepts-library", sort="likes", direction=-1)
86
  models = []
87
 
88
- pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", use_auth_token=True, revision="fp16", torch_dtype=torch.float16).to("cuda")
 
 
 
 
 
 
 
89
 
90
  def load_learned_embed_in_clip(learned_embeds_path, text_encoder, tokenizer, token=None):
91
  loaded_learned_embeds = torch.load(learned_embeds_path, map_location="cpu")
 
85
  models_list = api.list_models(author="sd-concepts-library", sort="likes", direction=-1)
86
  models = []
87
 
88
+ # NEW LOGIN ATTEMPT {{{
89
+ api_key = os.environ['api_key']
90
+ my_token = api_key
91
+
92
+ pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", revision="fp16", torch_dtype=torch.float16, use_auth_token=my_token).to("cuda")
93
+ # }}}
94
+
95
+ # pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", use_auth_token=True, revision="fp16", torch_dtype=torch.float16).to("cuda")
96
 
97
  def load_learned_embed_in_clip(learned_embeds_path, text_encoder, tokenizer, token=None):
98
  loaded_learned_embeds = torch.load(learned_embeds_path, map_location="cpu")