paralym commited on
Commit
5720255
1 Parent(s): dabf4be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -232,17 +232,17 @@ def bot(history):
232
  our_chatbot.conversation.append_message(our_chatbot.conversation.roles[1], None)
233
  prompt = our_chatbot.conversation.get_prompt()
234
 
235
- # input_ids = (
236
- # tokenizer_image_token(
237
- # prompt, our_chatbot.tokenizer, IMAGE_TOKEN_INDEX, return_tensors="pt"
238
- # )
239
- # .unsqueeze(0)
240
- # .to(our_chatbot.model.device)
241
- # )
242
- input_ids = tokenizer_image_token(
243
  prompt, our_chatbot.tokenizer, IMAGE_TOKEN_INDEX, return_tensors="pt"
244
- ).unsqueeze(0).to(our_chatbot.model.device)
245
-
 
 
 
 
 
 
246
  stop_str = (
247
  our_chatbot.conversation.sep
248
  if our_chatbot.conversation.sep_style != SeparatorStyle.TWO
@@ -361,7 +361,7 @@ with gr.Blocks(
361
  file_types=["image"],
362
  placeholder="Enter message or upload file...",
363
  show_label=False,
364
- submit_btn=False
365
  )
366
 
367
  print(cur_dir)
 
232
  our_chatbot.conversation.append_message(our_chatbot.conversation.roles[1], None)
233
  prompt = our_chatbot.conversation.get_prompt()
234
 
235
+ input_ids = (
236
+ tokenizer_image_token(
 
 
 
 
 
 
237
  prompt, our_chatbot.tokenizer, IMAGE_TOKEN_INDEX, return_tensors="pt"
238
+ )
239
+ .unsqueeze(0)
240
+ .to(our_chatbot.model.device)
241
+ )
242
+ # input_ids = tokenizer_image_token(
243
+ # prompt, our_chatbot.tokenizer, IMAGE_TOKEN_INDEX, return_tensors="pt"
244
+ # ).unsqueeze(0).to(our_chatbot.model.device)
245
+ print("### input_id",input_ids)
246
  stop_str = (
247
  our_chatbot.conversation.sep
248
  if our_chatbot.conversation.sep_style != SeparatorStyle.TWO
 
361
  file_types=["image"],
362
  placeholder="Enter message or upload file...",
363
  show_label=False,
364
+ submit_btn="🚀"
365
  )
366
 
367
  print(cur_dir)