Spaces:
Sleeping
Sleeping
File size: 563 Bytes
7791531 02e7c0e 7791531 02e7c0e 7791531 02e7c0e 7791531 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 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()
|