Spaces:
Runtime error
Runtime error
Commit
Β·
6f48f4c
1
Parent(s):
474bbb8
Update app.py
Browse files
app.py
CHANGED
@@ -80,23 +80,23 @@ def translate_to_english(text_to_translate):
|
|
80 |
# Gradio Output Model
|
81 |
with gr.Blocks() as demo:
|
82 |
gr.Markdown("Choose the Chinese NLP model you want to use from the tabs")
|
83 |
-
with gr.Tab("OpenAI Chatbot"):
|
84 |
chatbot = gr.Chatbot()
|
85 |
message = gr.Textbox(placeholder=prompt)
|
86 |
state = gr.State()
|
87 |
submit = gr.Button("SEND")
|
88 |
submit.click(chatgpt_clone, inputs=[message, state], outputs=[chatbot, state])
|
89 |
-
with gr.Tab("Sentiment Analysis"):
|
90 |
inputs = gr.Textbox(placeholder="Enter a Chinese positive or negative sentence here")
|
91 |
outputs = gr.Textbox(label="Sentiment Analysis")
|
92 |
proceed_button = gr.Button("proceed")
|
93 |
proceed_button.click(fn=sentiment_analysis, inputs=inputs, outputs=outputs)
|
94 |
-
with gr.Tab("Translation to Chinese"):
|
95 |
inputs = gr.Textbox(placeholder="Enter a short English sentence to translate to Chinese here.")
|
96 |
outputs = gr.Textbox(label="Translation Result")
|
97 |
proceed_button = gr.Button("Translate")
|
98 |
proceed_button.click(fn=translate_to_chinese, inputs=inputs, outputs=outputs)
|
99 |
-
with gr.Tab("Translation to English"):
|
100 |
inputs = gr.Textbox(placeholder="Enter a short Chinese sentence to translate to English here.")
|
101 |
outputs = gr.Textbox(label="Translation Result")
|
102 |
proceed_button = gr.Button("Translate")
|
|
|
80 |
# Gradio Output Model
|
81 |
with gr.Blocks() as demo:
|
82 |
gr.Markdown("Choose the Chinese NLP model you want to use from the tabs")
|
83 |
+
with gr.Tab("OpenAI Chatbotπ£οΈ"):
|
84 |
chatbot = gr.Chatbot()
|
85 |
message = gr.Textbox(placeholder=prompt)
|
86 |
state = gr.State()
|
87 |
submit = gr.Button("SEND")
|
88 |
submit.click(chatgpt_clone, inputs=[message, state], outputs=[chatbot, state])
|
89 |
+
with gr.Tab("Sentiment Analysisπ€"):
|
90 |
inputs = gr.Textbox(placeholder="Enter a Chinese positive or negative sentence here")
|
91 |
outputs = gr.Textbox(label="Sentiment Analysis")
|
92 |
proceed_button = gr.Button("proceed")
|
93 |
proceed_button.click(fn=sentiment_analysis, inputs=inputs, outputs=outputs)
|
94 |
+
with gr.Tab("Translation to Chineseπ"):
|
95 |
inputs = gr.Textbox(placeholder="Enter a short English sentence to translate to Chinese here.")
|
96 |
outputs = gr.Textbox(label="Translation Result")
|
97 |
proceed_button = gr.Button("Translate")
|
98 |
proceed_button.click(fn=translate_to_chinese, inputs=inputs, outputs=outputs)
|
99 |
+
with gr.Tab("Translation to Englishπ€"):
|
100 |
inputs = gr.Textbox(placeholder="Enter a short Chinese sentence to translate to English here.")
|
101 |
outputs = gr.Textbox(label="Translation Result")
|
102 |
proceed_button = gr.Button("Translate")
|