syedmudassir16 commited on
Commit
4c7e3fe
·
verified ·
1 Parent(s): bfd74d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -65,8 +65,6 @@ def format_prompt(message, history):
65
  Note: Mood should be classified only from any of these 4 classes {Happy, Sad, Instrumental, Party}, if not any of these 4 then continue with a follow-up question until you classify the mood.
66
 
67
  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.
68
-
69
-
70
  """
71
  prompt = f"{fixed_prompt}\n"
72
  for user_prompt, bot_response in history:
@@ -86,7 +84,7 @@ def process_input(input_text, history):
86
  return history, history, "", None
87
  response = generate(input_text, history)
88
  history.append((input_text, response))
89
- return history, history, "", None # Return history twice: once for state, once for chatbot, and reset voice input
90
 
91
  async def generate_audio(history):
92
  if history and len(history) > 0:
@@ -96,7 +94,7 @@ async def generate_audio(history):
96
  return None
97
 
98
  async def init_chat():
99
- history = [(INITIAL_MESSAGE)]
100
  audio_path = await text_to_speech(INITIAL_MESSAGE)
101
  return history, history, audio_path
102
 
 
65
  Note: Mood should be classified only from any of these 4 classes {Happy, Sad, Instrumental, Party}, if not any of these 4 then continue with a follow-up question until you classify the mood.
66
 
67
  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.
 
 
68
  """
69
  prompt = f"{fixed_prompt}\n"
70
  for user_prompt, bot_response in history:
 
84
  return history, history, "", None
85
  response = generate(input_text, history)
86
  history.append((input_text, response))
87
+ return history, history, "", None
88
 
89
  async def generate_audio(history):
90
  if history and len(history) > 0:
 
94
  return None
95
 
96
  async def init_chat():
97
+ history = [("", INITIAL_MESSAGE)]
98
  audio_path = await text_to_speech(INITIAL_MESSAGE)
99
  return history, history, audio_path
100