treasuraid commited on
Commit
dc6157e
·
1 Parent(s): 597e95c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -2,7 +2,7 @@ import diffusers
2
  import torch
3
  import os
4
  import time
5
-
6
  import streamlit as st
7
 
8
  from stqdm import stqdm
@@ -59,6 +59,7 @@ def main():
59
  st.image(sample, caption="An ape with solid gold fur and beanie")
60
 
61
  elapsed, pipeline = elapsed_time(load_pipeline_w_lora)
 
62
  st.write(f"Model is loaded in {elapsed} seconds!")
63
 
64
  prompt = st.text_input(
@@ -69,7 +70,7 @@ def main():
69
  seed = st.slider("Seed for images", 1, 10000, 1)
70
 
71
  if prompt and num_images and seed:
72
- st.write(f"Generating {num_images}BAYC image with prompt {prompt}...")
73
 
74
  generator = torch.Generator(device=device).manual_seed(seed)
75
  images = []
 
2
  import torch
3
  import os
4
  import time
5
+ import accelerate
6
  import streamlit as st
7
 
8
  from stqdm import stqdm
 
59
  st.image(sample, caption="An ape with solid gold fur and beanie")
60
 
61
  elapsed, pipeline = elapsed_time(load_pipeline_w_lora)
62
+ pipeline = pipeline.to(device)
63
  st.write(f"Model is loaded in {elapsed} seconds!")
64
 
65
  prompt = st.text_input(
 
70
  seed = st.slider("Seed for images", 1, 10000, 1)
71
 
72
  if prompt and num_images and seed:
73
+ st.write(f"Generating {num_images} BAYC image with prompt {prompt}...")
74
 
75
  generator = torch.Generator(device=device).manual_seed(seed)
76
  images = []