Update app.py
Browse files
app.py
CHANGED
@@ -15,18 +15,32 @@ def explain(input: str, lang: str):
|
|
15 |
|
16 |
_allow_langs=["English", "Chinese", "Japanese"]
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
if __name__=="__main__":
|
32 |
demo.launch()
|
|
|
15 |
|
16 |
_allow_langs=["English", "Chinese", "Japanese"]
|
17 |
|
18 |
+
demo = gr.Interface(
|
19 |
+
fn=explain,
|
20 |
+
inputs=[
|
21 |
+
gr.Textbox(label="Concept"),
|
22 |
+
gr.Dropdown(label="Language", choices=_allow_langs, value="English"),
|
23 |
+
],
|
24 |
+
outputs=[
|
25 |
+
'text',
|
26 |
+
],
|
27 |
+
title="Explainer",
|
28 |
+
description="an easy way to explain a concept in other language, get a better expression.",
|
29 |
+
head='<meta name="description" content="explain a concept in other language, get a better expression.">',
|
30 |
+
)
|
31 |
+
|
32 |
+
# with gr.Blocks() as demo:
|
33 |
+
# gr.Markdown('# concept explain')
|
34 |
+
|
35 |
+
# with gr.Row():
|
36 |
+
# with gr.Column():
|
37 |
+
# explain_input=gr.Textbox(label="Concept")
|
38 |
+
# explain_lang=gr.Dropdown(label="Language", choices=_allow_langs, value=_allow_langs[0])
|
39 |
+
# explain_btn=gr.Button("Run", variant="primary")
|
40 |
+
# with gr.Column():
|
41 |
+
# explain_result=gr.Textbox(label="Result")
|
42 |
+
|
43 |
+
# explain_btn.click(fn=explain, inputs=[explain_input, explain_lang], outputs=[explain_result])
|
44 |
|
45 |
if __name__=="__main__":
|
46 |
demo.launch()
|