lmzjms commited on
Commit
406619f
1 Parent(s): db7eba4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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
- print("======>Current memory:\n %s" % self.agent.memory)
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("Outputs:", state)
 
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)