Spaces:
Runtime error
Runtime error
Commit
·
2b2d98d
1
Parent(s):
78ca150
Upload folder using huggingface_hub
Browse files- .ipynb_checkpoints/README-checkpoint.md +1 -1
- .ipynb_checkpoints/app-checkpoint.py +4 -4
- README.md +1 -1
- app.py +4 -4
.ipynb_checkpoints/README-checkpoint.md
CHANGED
@@ -7,7 +7,7 @@ sdk: gradio
|
|
7 |
sdk_version: 3.35.2
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
-
startup_duration_timeout:
|
11 |
suggested_hardware: t4-medium
|
12 |
license: apache-2.0
|
13 |
---
|
|
|
7 |
sdk_version: 3.35.2
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
+
startup_duration_timeout: 4h
|
11 |
suggested_hardware: t4-medium
|
12 |
license: apache-2.0
|
13 |
---
|
.ipynb_checkpoints/app-checkpoint.py
CHANGED
@@ -20,12 +20,12 @@ magic_model = keras_cv.models.StableDiffusion(
|
|
20 |
)
|
21 |
|
22 |
magic_model.diffusion_model.load_weights(weights_path)
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
|
27 |
# Warm-up the model
|
28 |
-
|
29 |
|
30 |
def generate_image_fn(prompt: str, steps: int) -> list:
|
31 |
start_time = time.time()
|
|
|
20 |
)
|
21 |
|
22 |
magic_model.diffusion_model.load_weights(weights_path)
|
23 |
+
magic_model.diffusion_model.compile(jit_compile=True)
|
24 |
+
magic_model.decoder.compile(jit_compile=True)
|
25 |
+
magic_model.text_encoder.compile(jit_compile=True)
|
26 |
|
27 |
# Warm-up the model
|
28 |
+
_ = magic_model.text_to_image("flying dragons", batch_size=num_images_to_gen)
|
29 |
|
30 |
def generate_image_fn(prompt: str, steps: int) -> list:
|
31 |
start_time = time.time()
|
README.md
CHANGED
@@ -7,7 +7,7 @@ sdk: gradio
|
|
7 |
sdk_version: 3.35.2
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
-
startup_duration_timeout:
|
11 |
suggested_hardware: t4-medium
|
12 |
license: apache-2.0
|
13 |
---
|
|
|
7 |
sdk_version: 3.35.2
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
+
startup_duration_timeout: 4h
|
11 |
suggested_hardware: t4-medium
|
12 |
license: apache-2.0
|
13 |
---
|
app.py
CHANGED
@@ -20,12 +20,12 @@ magic_model = keras_cv.models.StableDiffusion(
|
|
20 |
)
|
21 |
|
22 |
magic_model.diffusion_model.load_weights(weights_path)
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
|
27 |
# Warm-up the model
|
28 |
-
|
29 |
|
30 |
def generate_image_fn(prompt: str, steps: int) -> list:
|
31 |
start_time = time.time()
|
|
|
20 |
)
|
21 |
|
22 |
magic_model.diffusion_model.load_weights(weights_path)
|
23 |
+
magic_model.diffusion_model.compile(jit_compile=True)
|
24 |
+
magic_model.decoder.compile(jit_compile=True)
|
25 |
+
magic_model.text_encoder.compile(jit_compile=True)
|
26 |
|
27 |
# Warm-up the model
|
28 |
+
_ = magic_model.text_to_image("flying dragons", batch_size=num_images_to_gen)
|
29 |
|
30 |
def generate_image_fn(prompt: str, steps: int) -> list:
|
31 |
start_time = time.time()
|