FLAG commited on
Commit ·
80169c7
1
Parent(s): 1b201fc
Creat app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from ch22_11 import flower_book
|
| 3 |
+
|
| 4 |
+
demo = gr.Interface(
|
| 5 |
+
fn=flower_book,
|
| 6 |
+
inputs=gr.Textbox(lines=2, label="花名", placeholder="輸入花名"),
|
| 7 |
+
outputs=gr.Textbox(lines=2, label="花語", placeholder="顯示相關花語"),
|
| 8 |
+
title="花語事典",
|
| 9 |
+
examples=[["玫瑰"],["向日葵"],["百合"],["薰衣草"],["薔薇"],
|
| 10 |
+
["康乃馨"],["水仙花"],["小蒼蘭"],["鬱金香"]],
|
| 11 |
+
description="這是一個花語查詢器,"
|
| 12 |
+
"輸入花名後會顯示相關的花語, 可以按一下範例查詢")
|
| 13 |
+
|
| 14 |
+
demo.launch()
|