amgad59 commited on
Commit
a256aa0
1 Parent(s): 7d22d9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -29,7 +29,7 @@ pokemon_model.decoder.compile(jit_compile=True)
29
  pokemon_model.text_encoder.compile(jit_compile=True)
30
 
31
  # Warm-up the model.
32
- _ = pokemon_model.text_to_image("Teddy bear", batch_size=num_images_to_gen)
33
 
34
 
35
  def generate_image_fn(prompt: str, unconditional_guidance_scale: int) -> list:
@@ -37,6 +37,7 @@ def generate_image_fn(prompt: str, unconditional_guidance_scale: int) -> list:
37
  # `images is an `np.ndarray`. So we convert it to a list of ndarrays.
38
  # Each ndarray represents a generated image.
39
  # Reference: https://gradio.app/docs/#gallery
 
40
  images = pokemon_model.text_to_image(
41
  prompt,
42
  batch_size=num_images_to_gen,
 
29
  pokemon_model.text_encoder.compile(jit_compile=True)
30
 
31
  # Warm-up the model.
32
+ #_ = pokemon_model.text_to_image("Teddy bear", batch_size=num_images_to_gen)
33
 
34
 
35
  def generate_image_fn(prompt: str, unconditional_guidance_scale: int) -> list:
 
37
  # `images is an `np.ndarray`. So we convert it to a list of ndarrays.
38
  # Each ndarray represents a generated image.
39
  # Reference: https://gradio.app/docs/#gallery
40
+ pokemon_model.to("cpu")
41
  images = pokemon_model.text_to_image(
42
  prompt,
43
  batch_size=num_images_to_gen,