Spaces:
Build error
Build error
Commit ·
cd35815
1
Parent(s): 4fefd0f
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,24 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
return greeting, round(celsius, 2)
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
)
|
| 14 |
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
| 16 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
def generate_text(input_text):
|
| 4 |
+
# Process the input text (your logic goes here)
|
| 5 |
+
# For demonstration purposes, simply return the input text
|
| 6 |
+
return input_text
|
|
|
|
| 7 |
|
| 8 |
+
def clear_text(input_text):
|
| 9 |
+
# Logic for clearing the text (e.g., returning an empty string)
|
| 10 |
+
return ""
|
| 11 |
+
|
| 12 |
+
iface = gr.Interface(
|
| 13 |
+
fn=generate_text,
|
| 14 |
+
inputs=gr.inputs.Textbox(prompt="Enter website address", lines=5, placeholder="Enter text here..."),
|
| 15 |
+
outputs=gr.outputs.Textbox(label="Generated Text", lines=5),
|
| 16 |
+
title="Text Generator",
|
| 17 |
+
theme="compact"
|
| 18 |
)
|
| 19 |
|
| 20 |
+
# Adding an additional input for clearing text
|
| 21 |
+
iface.add_input("textbox", label="Clear", type="textbox", lines=1, placeholder="Clear text")
|
| 22 |
+
|
| 23 |
+
iface.launch()
|
| 24 |
|