ashutoshzade commited on
Commit
c9c3efd
·
1 Parent(s): a6da76a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -20
app.py CHANGED
@@ -1,23 +1,14 @@
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(lines=5, placeholder="Input Text..."),
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="text", lines=1, placeholder="Clear text")
22
-
23
- iface.launch()
 
1
  import gradio as gr
2
 
3
+ def greet(name, is_morning, temperature):
4
+ salutation = "Good morning" if is_morning else "Good evening"
5
+ greeting = f"{salutation} {name}. It is {temperature} degrees today"
6
+ celsius = (temperature - 32) * 5 / 9
7
+ return greeting, round(celsius, 2)
8
+
9
+ demo = gr.Interface(
10
+ fn=greet,
11
+ inputs=["text", "number"],
12
+ outputs=["text", "number"],
 
 
 
 
 
13
  )
14
+ demo.launch()