syedmudassir16 commited on
Commit
726d5a9
·
verified ·
1 Parent(s): f77eb2a

condition

Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -18,6 +18,8 @@ def transcript_audio(audio_data):
18
 
19
  def format_prompt(message, history):
20
  # Your fixed prompt and history logic here, unchanged
 
 
21
  fixed_prompt = """
22
  You are a smart mood analyser, who determines user mood. Based on the user input, classify the mood of the user into one of the four moods {Happy, Sad, Instrumental, Party}. If you are finding it difficult to classify into one of these four moods, keep the conversation going on until we classify the user’s mood. Return a single response in the format "Playing [mood] playlist" where [mood] is one of the options if you have classified. Suppose you classify a sentence as happy, then respond with "Playing happy playlist".
23
 
 
18
 
19
  def format_prompt(message, history):
20
  # Your fixed prompt and history logic here, unchanged
21
+ if history is None:
22
+ history = []
23
  fixed_prompt = """
24
  You are a smart mood analyser, who determines user mood. Based on the user input, classify the mood of the user into one of the four moods {Happy, Sad, Instrumental, Party}. If you are finding it difficult to classify into one of these four moods, keep the conversation going on until we classify the user’s mood. Return a single response in the format "Playing [mood] playlist" where [mood] is one of the options if you have classified. Suppose you classify a sentence as happy, then respond with "Playing happy playlist".
25