import time import gradio as gr def spell(x): for i in range(len(x)): time.sleep(1) yield x[:i] gr.Interface(spell, "textbox", "textbox").launch()