Spaces:
Paused
Paused
Update app.py
Browse files
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,
|