Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,13 +35,17 @@ with gr.Blocks() as demo:
|
|
| 35 |
# ช่องข้อความที่ใช้รับ Prompt จากผู้ใช้
|
| 36 |
prompt_input = gr.Textbox(label='Prompt Input Text. 77 Token (Keyword or Symbol) Maximum')
|
| 37 |
|
| 38 |
-
# รูปภาพ
|
| 39 |
-
image1 = gr.Image(value="Img/img1.jpg", label="
|
| 40 |
-
image2 = gr.Image(value="Img/img2.jpg", label="
|
| 41 |
|
| 42 |
-
#
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
# ส่วนประกอบอื่น ๆ ของ Gradio Interface
|
| 47 |
gr.Interface(
|
|
@@ -65,3 +69,4 @@ with gr.Blocks() as demo:
|
|
| 65 |
|
| 66 |
# เริ่มการทำงานของ UI
|
| 67 |
demo.launch()
|
|
|
|
|
|
| 35 |
# ช่องข้อความที่ใช้รับ Prompt จากผู้ใช้
|
| 36 |
prompt_input = gr.Textbox(label='Prompt Input Text. 77 Token (Keyword or Symbol) Maximum')
|
| 37 |
|
| 38 |
+
# รูปภาพจากโฟลเดอร์
|
| 39 |
+
image1 = gr.Image(value="Img/img1.jpg", label="Bedroom Image")
|
| 40 |
+
image2 = gr.Image(value="Img/img2.jpg", label="Modern Image")
|
| 41 |
|
| 42 |
+
# ปุ่มที่ผู้ใช้จะคลิกเพื่อส่งข้อความ
|
| 43 |
+
button1 = gr.Button("Use 'bedroom' Prompt")
|
| 44 |
+
button2 = gr.Button("Use 'modern' Prompt")
|
| 45 |
+
|
| 46 |
+
# เชื่อมโยงปุ่มกับฟังก์ชันที่ส่งข้อความ
|
| 47 |
+
button1.click(fn=update_prompt_textbox, inputs=["bedroom"], outputs=prompt_input)
|
| 48 |
+
button2.click(fn=update_prompt_textbox, inputs=["modern"], outputs=prompt_input)
|
| 49 |
|
| 50 |
# ส่วนประกอบอื่น ๆ ของ Gradio Interface
|
| 51 |
gr.Interface(
|
|
|
|
| 69 |
|
| 70 |
# เริ่มการทำงานของ UI
|
| 71 |
demo.launch()
|
| 72 |
+
|