SamarthPujari commited on
Commit
32f7f24
·
verified ·
1 Parent(s): 19797b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -15,9 +15,12 @@ import torch
15
  # API Key for weather
16
  API_KEY = os.getenv("Weather_Token")
17
 
18
- device = "cuda" if torch.cuda.is_available() else "cpu"
 
 
19
  sd_pipe = StableDiffusionPipeline.from_pretrained(
20
  "runwayml/stable-diffusion-v1-5",
 
21
  torch_dtype=torch.float16 if device == "cuda" else torch.float32
22
  ).to(device)
23
 
 
15
  # API Key for weather
16
  API_KEY = os.getenv("Weather_Token")
17
 
18
+ hf_token = os.getenv("HF_TOKEN")
19
+ login(token=hf_token)
20
+
21
  sd_pipe = StableDiffusionPipeline.from_pretrained(
22
  "runwayml/stable-diffusion-v1-5",
23
+ use_auth_token=hf_token,
24
  torch_dtype=torch.float16 if device == "cuda" else torch.float32
25
  ).to(device)
26