Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -78,12 +78,11 @@ class ConversationBot:
|
|
78 |
else:
|
79 |
tool = res['intermediate_steps'][0][0].tool
|
80 |
if tool == "Generate Image From User Input Text":
|
81 |
-
|
82 |
response = re.sub('(image/\S*png)', lambda m: f'![](/file={m.group(0)})*{m.group(0)}*', res['output'])
|
83 |
-
image_filename = res['intermediate_steps'][0][1]
|
84 |
-
response = res['output'] + f"![](/file={image_filename})"
|
85 |
state = state + [(text, response)]
|
86 |
-
print("
|
|
|
87 |
return state, state, gr.Audio.update(visible=False), gr.Image.update(visible=False), gr.Button.update(visible=False)
|
88 |
elif tool == "Generate Text From The Audio" or tool == "Transcribe speech":
|
89 |
print("======>Current memory:\n %s" % self.agent.memory)
|
|
|
78 |
else:
|
79 |
tool = res['intermediate_steps'][0][0].tool
|
80 |
if tool == "Generate Image From User Input Text":
|
81 |
+
res['output'] = res['output'].replace("\\", "/")
|
82 |
response = re.sub('(image/\S*png)', lambda m: f'![](/file={m.group(0)})*{m.group(0)}*', res['output'])
|
|
|
|
|
83 |
state = state + [(text, response)]
|
84 |
+
print(f"\nProcessed run_text, Input text: {text}\nCurrent state: {state}\n"
|
85 |
+
f"Current Memory: {self.agent.memory.buffer}")
|
86 |
return state, state, gr.Audio.update(visible=False), gr.Image.update(visible=False), gr.Button.update(visible=False)
|
87 |
elif tool == "Generate Text From The Audio" or tool == "Transcribe speech":
|
88 |
print("======>Current memory:\n %s" % self.agent.memory)
|