Update app.py
Browse files
app.py
CHANGED
@@ -19,12 +19,13 @@ def clean(input_img):
|
|
19 |
ph_update = "gpt2 caption: '" + cap + "' β’ "
|
20 |
return manual_cap.update(value="",placeholder=f"{ph_update}{ph_message}"), caption_output.update(value=cap), sound_output.update(value=None)
|
21 |
|
22 |
-
def infer(image_input, manual_caption, duration_in, seed):
|
23 |
print(duration_in)
|
24 |
if manual_caption == "":
|
25 |
-
cap =
|
26 |
-
|
27 |
-
|
|
|
28 |
else:
|
29 |
cap = manual_caption
|
30 |
print("manual caption: " + cap)
|
@@ -112,7 +113,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
112 |
clean_out = [manual_cap, caption_output, sound_output]
|
113 |
input_img.change(clean, input_img, clean_out)
|
114 |
|
115 |
-
generate.click(infer, inputs=[input_img, manual_cap, duration_in, seed_in], outputs=[caption_output, sound_output, manual_cap, share_group], api_name="i2fx")
|
116 |
share_button.click(None, [], [], _js=share_js)
|
117 |
|
118 |
demo.queue(max_size=32).launch(debug=True)
|
|
|
19 |
ph_update = "gpt2 caption: '" + cap + "' β’ "
|
20 |
return manual_cap.update(value="",placeholder=f"{ph_update}{ph_message}"), caption_output.update(value=cap), sound_output.update(value=None)
|
21 |
|
22 |
+
def infer(image_input, manual_caption, duration_in, seed, caption_output):
|
23 |
print(duration_in)
|
24 |
if manual_caption == "":
|
25 |
+
cap = caption_output
|
26 |
+
#cap = caption(image_input, fn_index=0)
|
27 |
+
#print("gpt2 caption: '" + cap + "' β’ ")
|
28 |
+
#ph_update = "gpt2 caption: '" + cap + "' β’ "
|
29 |
else:
|
30 |
cap = manual_caption
|
31 |
print("manual caption: " + cap)
|
|
|
113 |
clean_out = [manual_cap, caption_output, sound_output]
|
114 |
input_img.change(clean, input_img, clean_out)
|
115 |
|
116 |
+
generate.click(infer, inputs=[input_img, manual_cap, duration_in, seed_in, caption_output], outputs=[caption_output, sound_output, manual_cap, share_group], api_name="i2fx")
|
117 |
share_button.click(None, [], [], _js=share_js)
|
118 |
|
119 |
demo.queue(max_size=32).launch(debug=True)
|