Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| def convert_text(text): | |
| """ | |
| Converts input text to uppercase and lowercase. | |
| """ | |
| if not text: | |
| return "", "" | |
| return text.upper(), text.lower() | |
| with gr.Blocks(title="Text Case Converter") as app: | |
| gr.Markdown("# Text Case Converter") | |
| gr.Markdown("Enter text below to see it converted into uppercase and lowercase.") | |
| text_input = gr.Textbox( | |
| label="Enter Text", | |
| placeholder="Type something here...", | |
| lines=4 | |
| ) | |
| uppercase_output = gr.Textbox( | |
| label="UPPERCASE Output", | |
| lines=4 | |
| ) | |
| lowercase_output = gr.Textbox( | |
| label="lowercase output", | |
| lines=4 | |
| ) | |
| convert_button = gr.Button("Convert") | |
| convert_button.click( | |
| fn=convert_text, | |
| inputs=text_input, | |
| outputs=[uppercase_output, lowercase_output] | |
| ) | |
| app.launch() | |