hysts's picture
hysts HF Staff
Update
9086143
raw
history blame
371 Bytes
#!/usr/bin/env python
import gradio as gr
import pandas as pd
df_empty = pd.DataFrame([], columns=['a', 'b'])
with gr.Blocks() as demo:
df = gr.Dataframe(interactive=False)
btn = gr.Button()
text = gr.Textbox()
btn.click(fn=lambda x: (gr.update(value=df_empty), len(x)),
inputs=df,
outputs=[df, text])
demo.queue().launch()