File size: 602 Bytes
1ce1659
 
22e1b62
1ce1659
 
22e1b62
 
1ce1659
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#display a data
import gradio as gr

def data_display(replace_df):
    return "aaaa"

with gr.Blocks() as demo:
    replace_df = gr.Dataframe(
        # headers=["Find what:", "Replace with:"],
        # datatype=["str", "str"],
        # row_count=(1, "dynamic"),
        # col_count=(2, "fixed"),
        # interactive=True
    )
    replace_button = gr.Button("Replace all")
    news_content = gr.Textbox(label="Content", value="", lines=12)
    
    
    replace_button.click(data_display, 
                        inputs=[replace_df], 
                        outputs=[news_content])
demo.launch()