leadingbridge commited on
Commit
a1f109b
Β·
1 Parent(s): 6f48f4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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")