Spaces:
Runtime error
Runtime error
#!/usr/bin/env python | |
import gradio as gr | |
import pandas as pd | |
def fn(df: pd.DataFrame) -> str: | |
return "a" | |
df_orig = pd.DataFrame(data={"a": [1, 2, 3]}) | |
with gr.Blocks() as demo: | |
df = gr.Dataframe(value=df_orig, type="pandas", interactive=False) | |
btn = gr.Button() | |
text = gr.Textbox() | |
btn.click(fn=fn, inputs=df, outputs=text) | |
if __name__ == "__main__": | |
demo.queue().launch() | |