Spaces:
Sleeping
Sleeping
| 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() | |