Spaces:
Runtime error
Runtime error
Damian Stewart
commited on
Commit
·
c40aefb
1
Parent(s):
bf1e262
attempt to fix reload errors
Browse files
app.py
CHANGED
@@ -273,12 +273,17 @@ class Demo:
|
|
273 |
info="Path or huggingface repo id of the base model that this edit was done against"
|
274 |
)
|
275 |
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
|
|
|
|
|
|
|
|
|
|
282 |
|
283 |
self.save_path_input_export = gr.Text(
|
284 |
label="Output path",
|
@@ -312,8 +317,12 @@ class Demo:
|
|
312 |
]
|
313 |
)
|
314 |
self.model_reload_button.click(self.reload_models,
|
315 |
-
inputs=[self.model_dropdown],
|
316 |
-
outputs=[self.model_dropdown])
|
|
|
|
|
|
|
|
|
317 |
train_event = self.train_button.click(self.train, inputs = [
|
318 |
self.train_model_input,
|
319 |
self.train_img_size_input,
|
@@ -347,14 +356,16 @@ class Demo:
|
|
347 |
self.save_path_input_export,
|
348 |
self.save_half_export
|
349 |
],
|
350 |
-
outputs=[self.export_button, self.export_status
|
351 |
)
|
352 |
|
353 |
-
def reload_models(self, model_dropdown):
|
354 |
current_model_name = model_dropdown
|
|
|
355 |
populate_global_model_map()
|
356 |
global model_names_list
|
357 |
-
return [
|
|
|
358 |
|
359 |
def cancel_training(self):
|
360 |
if self.training:
|
@@ -473,8 +484,7 @@ class Demo:
|
|
473 |
diffuser.pipeline.save_pretrained(save_path)
|
474 |
|
475 |
return [gr.update(interactive=True, value='Export'),
|
476 |
-
gr.update(value=f'Done Exporting!')
|
477 |
-
save_path]
|
478 |
|
479 |
|
480 |
def inference(self, prompt, negative_prompt, seed, width, height, model_name, base_repo_id_or_path, pbar = gr.Progress(track_tqdm=True)):
|
|
|
273 |
info="Path or huggingface repo id of the base model that this edit was done against"
|
274 |
)
|
275 |
|
276 |
+
with gr.Row():
|
277 |
+
self.model_dropdown_export = gr.Dropdown(
|
278 |
+
label="ESD Model",
|
279 |
+
choices=list(model_map.keys()),
|
280 |
+
value='Van Gogh',
|
281 |
+
interactive=True
|
282 |
+
)
|
283 |
+
self.model_reload_button_export = gr.Button(
|
284 |
+
value="🔄",
|
285 |
+
interactive=True
|
286 |
+
)
|
287 |
|
288 |
self.save_path_input_export = gr.Text(
|
289 |
label="Output path",
|
|
|
317 |
]
|
318 |
)
|
319 |
self.model_reload_button.click(self.reload_models,
|
320 |
+
inputs=[self.model_dropdown, self.model_dropdown_export],
|
321 |
+
outputs=[self.model_dropdown, self.model_dropdown_export])
|
322 |
+
|
323 |
+
self.model_reload_button_export.click(self.reload_models,
|
324 |
+
inputs=[self.model_dropdown, self.model_dropdown_export],
|
325 |
+
outputs=[self.model_dropdown, self.model_dropdown_export])
|
326 |
train_event = self.train_button.click(self.train, inputs = [
|
327 |
self.train_model_input,
|
328 |
self.train_img_size_input,
|
|
|
356 |
self.save_path_input_export,
|
357 |
self.save_half_export
|
358 |
],
|
359 |
+
outputs=[self.export_button, self.export_status]
|
360 |
)
|
361 |
|
362 |
+
def reload_models(self, model_dropdown, model_dropdown_export):
|
363 |
current_model_name = model_dropdown
|
364 |
+
current_model_name_export = model_dropdown_export
|
365 |
populate_global_model_map()
|
366 |
global model_names_list
|
367 |
+
return [gr.update(choices=model_names_list, value=current_model_name),
|
368 |
+
gr.update(choices=model_names_list, value=current_model_name_export)]
|
369 |
|
370 |
def cancel_training(self):
|
371 |
if self.training:
|
|
|
484 |
diffuser.pipeline.save_pretrained(save_path)
|
485 |
|
486 |
return [gr.update(interactive=True, value='Export'),
|
487 |
+
gr.update(value=f'Done Exporting! Diffusers folder is at {os.path.realpath(save_path)}.')]
|
|
|
488 |
|
489 |
|
490 |
def inference(self, prompt, negative_prompt, seed, width, height, model_name, base_repo_id_or_path, pbar = gr.Progress(track_tqdm=True)):
|