Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -93,7 +93,14 @@ class ConversationBot:
|
|
93 |
print(f"\nProcessed run_text, Input text: {text}\nCurrent state: {state}\n"
|
94 |
f"Current Memory: {self.agent.memory.buffer}")
|
95 |
return state, state, gr.Audio.update(visible=False), gr.Image.update(visible=False), gr.Button.update(visible=False)
|
96 |
-
elif tool == "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
print("======>Current memory:\n %s" % self.agent.memory)
|
98 |
response = re.sub('(image/\S*png)', lambda m: f'![](/file={m.group(0)})*{m.group(0)}*', res['output'])
|
99 |
image_filename = res['intermediate_steps'][0][1]
|
|
|
93 |
print(f"\nProcessed run_text, Input text: {text}\nCurrent state: {state}\n"
|
94 |
f"Current Memory: {self.agent.memory.buffer}")
|
95 |
return state, state, gr.Audio.update(visible=False), gr.Image.update(visible=False), gr.Button.update(visible=False)
|
96 |
+
elif tool == "Detect The Sound Event From The Audio":
|
97 |
+
image_filename = res['intermediate_steps'][0][1]
|
98 |
+
response = res['output'] + f"![](/file={image_filename})*{image_filename}*"
|
99 |
+
state = state + [(text, response)]
|
100 |
+
print(f"\nProcessed run_text, Input text: {text}\nCurrent state: {state}\n"
|
101 |
+
f"Current Memory: {self.agent.memory.buffer}")
|
102 |
+
return state, state, gr.Audio.update(visible=False), gr.Image.update(visible=False), gr.Button.update(visible=False)
|
103 |
+
elif tool == "Generate Text From The Audio" or tool == "Transcribe speech" or tool == "Target Sound Detection":
|
104 |
print("======>Current memory:\n %s" % self.agent.memory)
|
105 |
response = re.sub('(image/\S*png)', lambda m: f'![](/file={m.group(0)})*{m.group(0)}*', res['output'])
|
106 |
image_filename = res['intermediate_steps'][0][1]
|