import gradio as gr | |
from module import chat_with_memory | |
with gr.Blocks() as demo: | |
chatbot = gr.Chatbot() | |
txt = gr.Textbox(placeholder="Type your message and press β") | |
txt.submit(lambda msg, hist: (None, hist + [[msg, chat_with_memory(msg)]]), | |
[txt, chatbot], [txt, chatbot]) | |
if __name__ == "__main__": | |
demo.launch() | |