Spaces:
Build error
Build error
Mya-Mya
commited on
Commit
·
cf354bd
1
Parent(s):
8238b08
Create frontend.py
Browse files- frontend.py +15 -0
frontend.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from gradio import Blocks,Row,Group,Markdown,Textbox,Button,DataFrame as GRDataFrame
|
2 |
+
from backend import Backend
|
3 |
+
def launch_frontend(backend:Backend):
|
4 |
+
with Blocks() as frontend:
|
5 |
+
Markdown("""
|
6 |
+
自然言語処理モデル"Sentence BERT"を使って、ドラえもんのひみつ道具をあいまい検索。
|
7 |
+
自分の言葉でひみつ道具を説明してください。
|
8 |
+
""")
|
9 |
+
with Group():
|
10 |
+
query_textbox = Textbox(label="ひみつ道具の説明",max_lines=1)
|
11 |
+
submit_button = Button("検索")
|
12 |
+
result_table = GRDataFrame(label="検索結果")
|
13 |
+
|
14 |
+
submit_button.click(backend.on_submit_button_press,inputs=query_textbox,outputs=result_table)
|
15 |
+
frontend.launch()
|