Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
# Function to reverse the input text
|
| 4 |
+
def reverse_text(text):
|
| 5 |
+
return text[::-1]
|
| 6 |
+
|
| 7 |
+
# Create a Gradio interface
|
| 8 |
+
iface = gr.Interface(
|
| 9 |
+
fn=reverse_text, # Function to use for processing
|
| 10 |
+
inputs="text", # Input type: text
|
| 11 |
+
outputs="text", # Output type: text
|
| 12 |
+
title="Text Reverser", # Title of the interface
|
| 13 |
+
description="Enter text and it will be reversed!" # Description
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
# Launch the interface
|
| 17 |
+
iface.launch()
|