test_space / app.py
kurniawan
Convert to Gradio app
7791531
raw
history blame
563 Bytes
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()