amarax commited on
Commit
b64b14f
·
1 Parent(s): 5ee3993

Revert "Clicking the chatbot message now appends the image filename, if there's one."

Browse files

This reverts commit 00eb369148ffc3085a73179b9e4b30f129172d1c.

Files changed (1) hide show
  1. app.py +1 -9
app.py CHANGED
@@ -130,7 +130,7 @@ class ConversationBot:
130
  return state, state, f'{txt} {image_filename} '
131
 
132
  def init_agent(self, openai_api_key):
133
- self.llm = OpenAI(temperature=0, max_tokens=512, openai_api_key=openai_api_key)
134
  self.agent = initialize_agent(
135
  self.tools,
136
  self.llm,
@@ -218,14 +218,6 @@ with gr.Blocks(css="#chatbot {overflow:auto; height:500px;} .message img {max-wi
218
  run.click(bot.run_text, [txt, state], [chatbot, state])
219
  run.click(lambda: "", None, txt)
220
 
221
- def refer_to_image(evt: gr.SelectData, text):
222
- result = re.search(r"image\/\S+\.png", evt.value)
223
- if result:
224
- text = text + " " + result.group() + " "
225
- return text
226
-
227
- chatbot.select(refer_to_image, [txt], [txt])
228
-
229
  btn.upload(bot.run_image, [btn, state, txt], [chatbot, state, txt])
230
 
231
  clear.click(bot.memory.clear)
 
130
  return state, state, f'{txt} {image_filename} '
131
 
132
  def init_agent(self, openai_api_key):
133
+ self.llm = OpenAI(temperature=0.5, max_tokens=512, openai_api_key=openai_api_key)
134
  self.agent = initialize_agent(
135
  self.tools,
136
  self.llm,
 
218
  run.click(bot.run_text, [txt, state], [chatbot, state])
219
  run.click(lambda: "", None, txt)
220
 
 
 
 
 
 
 
 
 
221
  btn.upload(bot.run_image, [btn, state, txt], [chatbot, state, txt])
222
 
223
  clear.click(bot.memory.clear)