Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -187,7 +187,10 @@ def get_start_info(image_path, b_lora_name, instance_prompt):
|
|
187 |
|
188 |
return gr.update(visible=True, value=f"https://hf.co/{your_username}/{b_lora_name}"), gr.update(visible=True)
|
189 |
|
190 |
-
def main(image_path, b_lora_trained_folder, instance_prompt, training_type, training_steps):
|
|
|
|
|
|
|
191 |
|
192 |
local_dir = "image_to_train"
|
193 |
# Check if the directory exists and create it if necessary
|
@@ -400,7 +403,7 @@ with gr.Blocks(css=css) as demo:
|
|
400 |
show_api = False
|
401 |
).then(
|
402 |
fn = main,
|
403 |
-
inputs = [image, b_lora_name, instance_prompt, training_type, training_steps],
|
404 |
outputs = [status],
|
405 |
show_api = False
|
406 |
)
|
|
|
187 |
|
188 |
return gr.update(visible=True, value=f"https://hf.co/{your_username}/{b_lora_name}"), gr.update(visible=True)
|
189 |
|
190 |
+
def main(started_info, image_path, b_lora_trained_folder, instance_prompt, training_type, training_steps):
|
191 |
+
|
192 |
+
if started_info == None or started_info == "":
|
193 |
+
raise gr.Error("Training did not start.")
|
194 |
|
195 |
local_dir = "image_to_train"
|
196 |
# Check if the directory exists and create it if necessary
|
|
|
403 |
show_api = False
|
404 |
).then(
|
405 |
fn = main,
|
406 |
+
inputs = [started_info, image, b_lora_name, instance_prompt, training_type, training_steps],
|
407 |
outputs = [status],
|
408 |
show_api = False
|
409 |
)
|