Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| def process_input(text): | |
| if not text: | |
| return "Please enter some text!" | |
| output = f""" | |
| You entered: {text} | |
| Character count: {len(text)} | |
| Word count: {len(text.split())} | |
| """ | |
| return output | |
| demo = gr.Interface( | |
| fn=process_input, | |
| inputs=gr.Textbox(label="Enter your text", placeholder="Type something here..."), | |
| outputs=gr.Textbox(label="Output"), | |
| title="Simple Input/Output App", | |
| description="Enter text and see character and word count" | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch() | |