import gradio as gr | |
# Function to reverse the input text | |
def reverse_text(text): | |
return text[::-1] | |
# Create a Gradio interface | |
iface = gr.Interface( | |
fn=reverse_text, # Function to use for processing | |
inputs="text", # Input type: text | |
outputs="text", # Output type: text | |
title="Text Reverser", # Title of the interface | |
description="Enter text and it will be reversed!" # Description | |
) | |
# Launch the interface | |
iface.launch() | |