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

def combine_text(text1, text2):
    lines1 = text1.strip().split("\n")
    lines2 = text2.strip().split("\n")
    output = [f"{a}, {b}" for a in lines1 for b in lines2]
    return "\n".join(output)

with gr.Blocks() as app:
    gr.Markdown("# Text Combiner")
    with gr.Row():
        input1 = gr.Textbox(lines=3, placeholder="Enter first set of text (one per line)")
        input2 = gr.Textbox(lines=3, placeholder="Enter second set of text (one per line)")
    output = gr.Textbox(lines=9, interactive=False)
    combine_btn = gr.Button("Combine")
    
    combine_btn.click(combine_text, inputs=[input1, input2], outputs=output)

app.launch()