KingNish commited on
Commit
d9766c7
1 Parent(s): 489c872

Update chatbot.py

Browse files
Files changed (1) hide show
  1. chatbot.py +4 -5
chatbot.py CHANGED
@@ -201,10 +201,6 @@ system_llava = "<|im_start|>system\nYou are OpenGPT 4o, an exceptionally capable
201
 
202
  @spaces.GPU(duration=60, queue=False)
203
  def model_inference( user_prompt, chat_history, web_search):
204
- # Define generation_args at the beginning of the function
205
- generation_args = {}
206
-
207
- # Web search logic
208
  if not user_prompt["files"]:
209
  if web_search is True:
210
 
@@ -247,7 +243,10 @@ def model_inference( user_prompt, chat_history, web_search):
247
  output += response.token.text
248
  yield output
249
  else:
250
- image = user_prompt["files"][-1]
 
 
 
251
 
252
  txt = user_prompt["text"]
253
  img = user_prompt["files"]
 
201
 
202
  @spaces.GPU(duration=60, queue=False)
203
  def model_inference( user_prompt, chat_history, web_search):
 
 
 
 
204
  if not user_prompt["files"]:
205
  if web_search is True:
206
 
 
243
  output += response.token.text
244
  yield output
245
  else:
246
+ if len(message.files) == 1:
247
+ image = [message.files[0].path]
248
+ elif len(message.files) > 1:
249
+ image = [msg.path for msg in message.files]
250
 
251
  txt = user_prompt["text"]
252
  img = user_prompt["files"]