simonraj commited on
Commit
675ecd6
Β·
verified Β·
1 Parent(s): b9ce51c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -59,14 +59,14 @@ def bot_streaming(message, history):
59
  conversation.extend([{"role": "user", "content": ""}])
60
  continue
61
  if flag:
62
- conversation[0]['content'] = f"<|image|>\n{user}"
63
  conversation.extend([{"role": "assistant", "content": assistant}])
64
  flag = False
65
  continue
66
  conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
67
 
68
  if len(history) == 0:
69
- conversation.append({"role": "user", "content": f"<|image|>\n{message['text']}"})
70
  else:
71
  conversation.append({"role": "user", "content": message['text']})
72
 
@@ -95,7 +95,6 @@ def bot_streaming(message, history):
95
  yield buffer
96
 
97
 
98
-
99
  chatbot = gr.Chatbot(scale=1, placeholder=PLACEHOLDER)
100
  chat_input = gr.MultimodalTextbox(interactive=True, file_types=["image"], placeholder="Enter message or upload file...", show_label=False)
101
  with gr.Blocks(fill_height=True,) as demo:
 
59
  conversation.extend([{"role": "user", "content": ""}])
60
  continue
61
  if flag:
62
+ conversation[0]['content'] = f"<|image_1|>\n{user}"
63
  conversation.extend([{"role": "assistant", "content": assistant}])
64
  flag = False
65
  continue
66
  conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
67
 
68
  if len(history) == 0:
69
+ conversation.append({"role": "user", "content": f"<|image_1|>\n{message['text']}"})
70
  else:
71
  conversation.append({"role": "user", "content": message['text']})
72
 
 
95
  yield buffer
96
 
97
 
 
98
  chatbot = gr.Chatbot(scale=1, placeholder=PLACEHOLDER)
99
  chat_input = gr.MultimodalTextbox(interactive=True, file_types=["image"], placeholder="Enter message or upload file...", show_label=False)
100
  with gr.Blocks(fill_height=True,) as demo: