File size: 558 Bytes
d5ac253
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr

count = 0


def party(str_1, str_2, str_3):
    if count % 3 == 0:
        return str_1, "Blocks Party 😌 " + str_3, "Blocks Party 😌 " + str_2


with gr.Blocks() as demo:
    text_1 = gr.component("textarea")
    text_2 = gr.component("textarea")
    text_3 = gr.component("textarea")

    text_1.change(party, [text_1, text_2, text_3], [text_1, text_2, text_3])
    text_2.change(party, [text_2, text_1, text_3], [text_2, text_1, text_3])
    text_3.change(party, [text_3, text_1, text_2], [text_3, text_1, text_2])

demo.launch()