Kohaku-Blueleaf
commited on
Commit
·
e5e8e19
1
Parent(s):
df59904
fixes
Browse files
app.py
CHANGED
@@ -189,9 +189,7 @@ kgen_models.download_gguf(
|
|
189 |
tipo_model_name,
|
190 |
gguf_list[-1],
|
191 |
)
|
192 |
-
|
193 |
-
f"{tipo_model_name}_{gguf_list[-1]}", gguf=True, device="cpu"
|
194 |
-
)
|
195 |
print("Models loaded successfully. UI is ready.")
|
196 |
|
197 |
|
@@ -210,6 +208,12 @@ def generate(
|
|
210 |
seed: int,
|
211 |
progress=gr.Progress(),
|
212 |
):
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
as_w, as_h = aspect_ratio.split(":")
|
214 |
aspect_ratio = float(as_w) / float(as_h)
|
215 |
# Set seed for reproducibility
|
|
|
189 |
tipo_model_name,
|
190 |
gguf_list[-1],
|
191 |
)
|
192 |
+
tipo_loaded = False
|
|
|
|
|
193 |
print("Models loaded successfully. UI is ready.")
|
194 |
|
195 |
|
|
|
208 |
seed: int,
|
209 |
progress=gr.Progress(),
|
210 |
):
|
211 |
+
global tipo_loaded
|
212 |
+
if not tipo_loaded:
|
213 |
+
kgen_models.load_model(
|
214 |
+
f"{tipo_model_name}_{gguf_list[-1]}", gguf=True, device="cpu"
|
215 |
+
)
|
216 |
+
tipo_loaded = True
|
217 |
as_w, as_h = aspect_ratio.split(":")
|
218 |
aspect_ratio = float(as_w) / float(as_h)
|
219 |
# Set seed for reproducibility
|