import torch import gradio as gr from gen import get_pretrained_models, get_output, setup_model_parallel def chat(user_input): bot_response = "hello world" response = "" for word in bot_response.split(" "): response = response + " " + word yield response with gr.Blocks() as demo: chatbot = gr.Chatbot() textbox = gr.Textbox("Hello, how are you doing today?") textbox.submit(chat, textbox, chatbot) demo.queue().launch()