Spaces:
Runtime error
Runtime error
import gradio as gr | |
import my_uie | |
import face_emo_analysize | |
def text_emo_analysize(text): | |
text_outcome = my_uie.emo_analy(text) | |
return text_outcome | |
def face_emo_analyze(): | |
# ๅ่ฎพ face_emo_analysize.face_emo_analysize() ไผๆๅผๆๅๅคดๅนถๆ่ท่กจๆ | |
face_outcome = face_emo_analysize.face_emo_analysize() | |
return face_outcome | |
# ๅๅปบGradio็้ข | |
with gr.Blocks() as demo: | |
gr.Markdown("# ๆ ๆๅๆๅบ็จ") | |
gr.Markdown("่พๅ ฅไฟกๆฏ๏ผ่ทๅๆ ๆๅๆ็ปๆใ") | |
with gr.Row(): | |
with gr.Column(): | |
text_input = gr.Textbox(lines=2, placeholder='ๅจ่ฟ้่พๅ ฅๆๆฌ') | |
text_submit_button = gr.Button("ๆไบคๆๆฌๆ ๆๅๆ") | |
text_output = gr.Textbox(label="ๆๆฌๆ ๆๅๆ็ปๆ") | |
with gr.Row(): | |
face_button = gr.Button("ๆง่ก้ข้จๆ ๆๅๆ") | |
face_output = gr.Textbox(label="้ข้จๆ ๆๅๆ็ปๆ") | |
def on_face_button_click(): | |
# ่ฐ็จ face_emo_analyze ๅฝๆฐๅนถ่ฟๅ็ปๆ | |
face_outcome = face_emo_analyze() | |
return face_outcome | |
face_button.click(on_face_button_click, inputs=None, outputs=face_output) | |
text_submit_button.click(text_emo_analysize, inputs=text_input, outputs=text_output) | |
demo.launch() |