|
from handler import SweetCommander |
|
import gradio as gr |
|
|
|
controller = SweetCommander() |
|
|
|
with gr.Blocks() as demo: |
|
history = gr.State([]) |
|
with gr.Row() as row: |
|
with gr.Column(): |
|
user_name = gr.Textbox(label="Name", placeholder="Enter your name") |
|
user_input = gr.Textbox(label="Input", placeholder="Enter your message") |
|
button = gr.Button("Enter") |
|
with gr.Column(): |
|
output = gr.Textbox(label="Response") |
|
|
|
def guess_letter(user_name, user_input): |
|
response = controller(user_name, user_input) |
|
return { |
|
output: response |
|
} |
|
button.click( |
|
guess_letter, |
|
[user_name, user_input], |
|
[output] |
|
) |
|
demo.launch() |