test-perf-pr / app.py
pngwn's picture
pngwn HF Staff
Update app.py
07ade65 verified
raw
history blame contribute delete
646 Bytes
import gradio as gr
import random
import time
with gr.Blocks() as demo:
chatbot = gr.Chatbot(label="test-perf-4.19")
msg = gr.Textbox()
clear = gr.ClearButton([msg, chatbot])
for i in range(2000):
gr.Button("hi", visible=False)
def respond(message, chat_history):
bot_message = "How are you?" * 10000
chat_history.append((message, bot_message))
for i in range(2000):
chat_history[-1] = (chat_history[-1][0], chat_history[-1][1] + " " + str(i))
yield "", chat_history
print("done")
msg.submit(respond, [msg, chatbot], [msg, chatbot])
demo.launch()