File size: 761 Bytes
b7be07b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
069dbbe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import gradio as gr
from MLMbanner import get_html
from utils import chatbot_response


with gr.Blocks() as demo:
    gr.HTML(value=get_html, show_label=True)

    with gr.Row():
        text_input = gr.Textbox(label="Enter text", lines=10)
        image_input = gr.Image(label="Upload image", type="pil")
        audio_input = gr.Audio(label="Record or upload audio", 
                               type="filepath", 
                               sources=['microphone', 'upload'])
        
        submit_button = gr.Button("Submit")

    output = gr.Textbox(label="Chatbot Response", lines=10)

    submit_button.click(
        fn=chatbot_response,
        inputs=[text_input, image_input, audio_input],
        outputs=output
    )

demo.launch(debug=True)