AdityaBolt commited on
Commit
6dc480c
ยท
verified ยท
1 Parent(s): 5f1e18d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -35
app.py CHANGED
@@ -1,41 +1,13 @@
1
  import gradio as gr
2
 
3
- def greet(name, occasion, tone, emoji_count):
 
 
 
 
 
4
 
5
- greetings = {
6
- "friendly": "Hey there",
7
- "formal": "Dear",
8
- "funny": "What's up"
9
- }
10
-
11
 
12
- body_text = f"{greetings[tone]} {name},\n\n" \
13
- f"I just wanted to drop you a note because I heard it's your {occasion}. " \
14
- "What a day to celebrate! ๐ŸŽ‰ " \
15
- "I hope your day is filled with laughter, joy, and cake! Lots of cake! ๐ŸŽ‚\n\n"
16
-
17
 
18
- if tone == "friendly":
19
- closing = "Catch you later,\n- Your buddy"
20
- elif tone == "formal":
21
- closing = "Sincerely,\n- [Your Name Here]"
22
- else: # funny
23
- closing = "Stay awesome (I know you will),\n- Your coolest friend"
24
-
25
-
26
- emojis = "๐Ÿ˜Š" * emoji_count
27
- return body_text + closing + "\n" + emojis
28
-
29
-
30
- inputs = [
31
- gr.inputs.Textbox(lines=2, label="Name"),
32
- gr.inputs.Textbox(lines=2, label="Occasion"),
33
- gr.inputs.Dropdown(choices=["friendly", "formal", "funny"], label="Tone"),
34
- gr.inputs.Slider(minimum=1, maximum=10, default=3, label="Number of Emojis")
35
- ]
36
-
37
- output = gr.outputs.Textbox(label="Your Personalized Letter")
38
-
39
-
40
- iface = gr.Interface(fn=hello_world, inputs="text", outputs="text")
41
  iface.launch()
 
1
  import gradio as gr
2
 
3
+ def greet(name):
4
+ letter = f"Dear {name},\n\n" \
5
+ "I hope this note finds you well. Your smile brightens everyone's day, " \
6
+ "and I just wanted to take a moment to tell you how much you mean to those around you. " \
7
+ "- Your Friend"
8
+ return letter
9
 
 
 
 
 
 
 
10
 
11
+ iface = gr.Interface(fn=write_letter, inputs="text", outputs="text")
 
 
 
 
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  iface.launch()