syedmudassir16 commited on
Commit
b18f307
·
verified ·
1 Parent(s): b0bd85e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +160 -3
app.py CHANGED
@@ -23,8 +23,165 @@ def format_prompt(message, history):
23
 
24
  Note: if user asks something like i need a coffee then do not classify the mood directly and ask more follow-up questions as asked in examples.
25
 
26
- [Examples omitted for brevity]
27
- """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  prompt = f"<s>{fixed_prompt}"
29
  for user_prompt, bot_response in history:
30
  prompt += f"\n User:{user_prompt}\n LLM Response:{bot_response}"
@@ -138,7 +295,7 @@ with gr.Blocks(css="""
138
 
139
  with gr.Row():
140
  with gr.Column():
141
- audio_input = gr.Audio(source="microphone", type="filepath", label="Upload Audio or Use Microphone")
142
  submit_button = gr.Button("Submit")
143
 
144
  with gr.Column():
 
23
 
24
  Note: if user asks something like i need a coffee then do not classify the mood directly and ask more follow-up questions as asked in examples.
25
 
26
+ Examples
27
+ User: What is C programming?
28
+ LLM Response: C programming is a programming language. How are you feeling now after knowing the answer?
29
+
30
+ User: Can I get a coffee?
31
+ LLM Response: It sounds like you're in need of a little pick-me-up. How are you feeling right now? Are you looking for something upbeat, something to relax to, or maybe some instrumental music while you enjoy your coffee?
32
+ User: I feel like rocking
33
+ LLM Response: Party
34
+
35
+ User: I'm feeling so energetic today!
36
+ LLM Response: Happy
37
+
38
+ User: I'm feeling down today.
39
+ LLM Response: Sad
40
+
41
+ User: I'm ready to have some fun tonight!
42
+ LLM Response: Party
43
+
44
+ User: I need some background music while I am stuck in traffic.
45
+ LLM Response: Instrumental
46
+
47
+ User: Hi
48
+ LLM Response: Hi, how are you doing?
49
+
50
+ User: Feeling okay only.
51
+ LLM Response: Are you having a good day?
52
+ User: I don't know
53
+ LLM Response: Do you want to listen to some relaxing music?
54
+ User: No
55
+ LLM Response: How about listening to some rock and roll music?
56
+ User: Yes
57
+ LLM Response: Party
58
+
59
+ User: Where do I find an encyclopedia?
60
+ LLM Response: You can find it in any of the libraries or on the Internet. Does this answer make you happy?
61
+
62
+ User: I need a coffee
63
+ LLM Response: It sounds like you're in need of a little pick-me-up. How are you feeling right now? Are you looking for something upbeat, something to relax to, or maybe some instrumental music while you enjoy your coffee?
64
+
65
+ User: I just got promoted at work!
66
+ LLM Response: Happy
67
+
68
+ User: Today is my birthday!
69
+ LLM Response: Happy
70
+
71
+ User: I won a prize in the lottery.
72
+ LLM Response: Happy
73
+
74
+ User: I am so excited about my vacation next week!
75
+ LLM Response: Happy
76
+
77
+ User: I aced my exams!
78
+ LLM Response: Happy
79
+
80
+ User: I had a wonderful time with my family today.
81
+ LLM Response: Happy
82
+
83
+ User: I just finished a great workout!
84
+ LLM Response: Happy
85
+
86
+ User: I am feeling really good about myself today.
87
+ LLM Response: Happy
88
+
89
+ User: I finally finished my project and it was a success!
90
+ LLM Response: Happy
91
+
92
+ User: I just heard my favorite song on the radio.
93
+ LLM Response: Happy
94
+
95
+ User: My pet passed away yesterday.
96
+ LLM Response: Sad
97
+
98
+ User: I lost my job today.
99
+ LLM Response: Sad
100
+
101
+ User: I'm feeling really lonely.
102
+ LLM Response: Sad
103
+
104
+ User: I didn't get the results I wanted.
105
+ LLM Response: Sad
106
+
107
+ User: I had a fight with my best friend.
108
+ LLM Response: Sad
109
+
110
+ User: I'm feeling really overwhelmed with everything.
111
+ LLM Response: Sad
112
+
113
+ User: I just got some bad news.
114
+ LLM Response: Sad
115
+
116
+ User: I'm missing my family.
117
+ LLM Response: Sad
118
+
119
+ User: I am feeling really down today.
120
+ LLM Response: Sad
121
+
122
+ User: Nothing seems to be going right.
123
+ LLM Response: Sad
124
+
125
+ User: I need some music while I study.
126
+ LLM Response: Instrumental
127
+
128
+ User: I want to listen to something soothing while I work.
129
+ LLM Response: Instrumental
130
+
131
+ User: Do you have any recommendations for background music?
132
+ LLM Response: Instrumental
133
+
134
+ User: I'm looking for some relaxing tunes.
135
+ LLM Response: Instrumental
136
+
137
+ User: I need some music to focus on my tasks.
138
+ LLM Response: Instrumental
139
+
140
+ User: Can you suggest some ambient music for meditation?
141
+ LLM Response: Instrumental
142
+
143
+ User: What's good for background music during reading?
144
+ LLM Response: Instrumental
145
+
146
+ User: I need some calm music to help me sleep.
147
+ LLM Response: Instrumental
148
+
149
+ User: I prefer instrumental music while cooking.
150
+ LLM Response: Instrumental
151
+
152
+ User: What's the best music to play while doing yoga?
153
+ LLM Response: Instrumental
154
+
155
+ User: Let's have a blast tonight!
156
+ LLM Response: Party
157
+
158
+ User: I'm in the mood to dance!
159
+ LLM Response: Party
160
+
161
+ User: I want to celebrate all night long!
162
+ LLM Response: Party
163
+
164
+ User: Time to hit the club!
165
+ LLM Response: Party
166
+
167
+ User: I feel like partying till dawn.
168
+ LLM Response: Party
169
+
170
+ User: Let's get this party started!
171
+ LLM Response: Party
172
+
173
+ User: I'm ready to party hard tonight.
174
+ LLM Response: Party
175
+
176
+ User: I'm in the mood for some loud music and dancing!
177
+ LLM Response: Party
178
+
179
+ User: Tonight's going to be epic!
180
+ LLM Response: Party
181
+
182
+ User: Lets turn up the music and have some fun!
183
+ LLM Response: Party
184
+ """
185
  prompt = f"<s>{fixed_prompt}"
186
  for user_prompt, bot_response in history:
187
  prompt += f"\n User:{user_prompt}\n LLM Response:{bot_response}"
 
295
 
296
  with gr.Row():
297
  with gr.Column():
298
+ audio_input = gr.Audio(sources="microphone", type="filepath", label="Upload Audio or Use Microphone")
299
  submit_button = gr.Button("Submit")
300
 
301
  with gr.Column():