Update app.py
Browse files
app.py
CHANGED
@@ -206,7 +206,6 @@ def process_and_show_prompt(image1, image2, image3, prompt):
|
|
206 |
logger.exception("์ฒ๋ฆฌ ์ค ์ค๋ฅ ๋ฐ์:")
|
207 |
return None, f"์ค๋ฅ ๋ฐ์: {str(e)}", prompt
|
208 |
|
209 |
-
# Gradio ์ธํฐํ์ด์ค๋ฅผ ํ๋์ Blocks()๋ก ๊ตฌ์ฑ
|
210 |
with gr.Blocks() as demo:
|
211 |
gr.HTML(
|
212 |
"""
|
@@ -244,7 +243,6 @@ with gr.Blocks() as demo:
|
|
244 |
)
|
245 |
prompt_display = gr.Textbox(label="Used Prompt (English)", visible=True)
|
246 |
|
247 |
-
# ์์ ์คํ ์ ์๋์ผ๋ก image_input ๋ฐ prompt_input์ ๊ฐ ์ฑ์์ง
|
248 |
gr.Markdown("## Try these examples", elem_classes="gr-examples-header")
|
249 |
|
250 |
examples = [
|
@@ -253,14 +251,18 @@ with gr.Blocks() as demo:
|
|
253 |
]
|
254 |
|
255 |
gr.Examples(
|
|
|
256 |
examples=examples,
|
257 |
inputs=[image_input, prompt_input],
|
|
|
|
|
258 |
elem_id="examples-grid"
|
259 |
)
|
260 |
|
|
|
261 |
submit_btn.click(
|
262 |
-
fn=process_and_show_prompt,
|
263 |
-
inputs=[image_input,
|
264 |
outputs=[output_gallery, output_text, prompt_display],
|
265 |
)
|
266 |
|
|
|
206 |
logger.exception("์ฒ๋ฆฌ ์ค ์ค๋ฅ ๋ฐ์:")
|
207 |
return None, f"์ค๋ฅ ๋ฐ์: {str(e)}", prompt
|
208 |
|
|
|
209 |
with gr.Blocks() as demo:
|
210 |
gr.HTML(
|
211 |
"""
|
|
|
243 |
)
|
244 |
prompt_display = gr.Textbox(label="Used Prompt (English)", visible=True)
|
245 |
|
|
|
246 |
gr.Markdown("## Try these examples", elem_classes="gr-examples-header")
|
247 |
|
248 |
examples = [
|
|
|
251 |
]
|
252 |
|
253 |
gr.Examples(
|
254 |
+
fn=lambda img, pr: process_and_show_prompt(img, None, None, pr),
|
255 |
examples=examples,
|
256 |
inputs=[image_input, prompt_input],
|
257 |
+
outputs=[output_gallery, output_text, prompt_display],
|
258 |
+
run_on_click=True,
|
259 |
elem_id="examples-grid"
|
260 |
)
|
261 |
|
262 |
+
# submit_btn ํด๋ฆญ ์ image2, image3๋ None์ผ๋ก ์ ๋ฌ
|
263 |
submit_btn.click(
|
264 |
+
fn=lambda img, pr, key: process_and_show_prompt(img, None, None, pr),
|
265 |
+
inputs=[image_input, prompt_input, gemini_api_key],
|
266 |
outputs=[output_gallery, output_text, prompt_display],
|
267 |
)
|
268 |
|