JJteam commited on
Commit
93e0370
1 Parent(s): 9189a48

updating title and release note

Browse files
.gitattributes CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ *.png filter=lfs diff=lfs merge=lfs -text
MM-REACT/app.py CHANGED
@@ -26,8 +26,9 @@ logger = None
26
 
27
 
28
  OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")
29
- BUG_FOUND_MSG = "There is a bug in the application!"
30
  AUTH_ERR_MSG = "OpenAI key needed"
 
31
  MAX_TOKENS = 512
32
 
33
 
@@ -368,14 +369,18 @@ def replace_with_image_markup(text):
368
  # multi line response handling
369
  def process_chain_output(outputs):
370
  global ARGS
 
371
  # print("outputs {}".format(outputs))
372
  if isinstance(outputs, str): # single line output
 
 
373
  outputs = [outputs]
374
  elif isinstance(outputs, list): # multi line output
375
  if ARGS.noIntermediateConv: # remove the items with assistant in it.
376
  cleanOutputs = []
377
  for output in outputs:
378
- # print("inside loop outputs {}".format(output))
 
379
  # found an edited image url to embed
380
  img_url = None
381
  # print ("type list: {}".format(output))
@@ -398,6 +403,7 @@ def init_and_kick_off():
398
  chat = ChatWrapper()
399
 
400
  exampleTitle = """<h3>Examples to start conversation..</h3>"""
 
401
 
402
  with gr.Blocks(css="#tryButton {width: 120px;}") as block:
403
  llm_state = gr.State()
@@ -406,6 +412,7 @@ def init_and_kick_off():
406
  log_state = gr.State()
407
 
408
  reset_btn = gr.Button(value="!!!CLICK to wake up MM-REACT!!!", variant="primary", elem_id="resetbtn").style(full_width=True)
 
409
 
410
  example_image_size = 90
411
  col_min_width = 80
@@ -432,25 +439,26 @@ def init_and_kick_off():
432
  example1ImagePath = gr.Text("images/money.png", interactive=False, visible=False)
433
  with gr.Row():
434
  with gr.Column(scale=0.50, min_width=col_min_width):
435
- example2Image = gr.Image("images/bar_plot.png", interactive=False).style(height=example_image_size, width=example_image_size)
436
  with gr.Column(scale=0.50, min_width=col_min_width):
437
  example2ImageButton = gr.Button(elem_id="tryButton", value="Try it!", variant=button_variant).style(full_width=True)
438
  # dummy text field to hold the path
439
- example2ImagePath = gr.Text("images/bar_plot.png", interactive=False, visible=False)
440
  with gr.Row():
441
  with gr.Column(scale=0.50, min_width=col_min_width):
442
- example4Image = gr.Image("images/sign.png", interactive=False).style(height=example_image_size, width=example_image_size)
443
  with gr.Column(scale=0.50, min_width=col_min_width):
444
  example4ImageButton = gr.Button(elem_id="tryButton", value="Try it!", variant=button_variant).style(full_width=True)
445
  # dummy text field to hold the path
446
- example4ImagePath = gr.Text("images/sign.png", interactive=False, visible=False)
447
  with gr.Row():
448
  with gr.Column(scale=0.50, min_width=col_min_width):
449
- example5Image = gr.Image("images/face.jpg", interactive=False).style(height=example_image_size, width=example_image_size)
450
  with gr.Column(scale=0.50, min_width=col_min_width):
451
  example5ImageButton = gr.Button(elem_id="tryButton", value="Try it!", variant=button_variant).style(full_width=True)
452
  # dummy text field to hold the path
453
- example5ImagePath = gr.Text("images/face.jpg", interactive=False, visible=False)
 
454
 
455
 
456
  with gr.Row():
@@ -494,5 +502,4 @@ if __name__ == '__main__':
494
  global ARGS
495
  ARGS = parser.parse_args()
496
 
497
- init_and_kick_off()
498
-
 
26
 
27
 
28
  OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY")
29
+ BUG_FOUND_MSG = "Some Functionalities not supported yet. Please refresh and hit 'Click to wake up MM-REACT'"
30
  AUTH_ERR_MSG = "OpenAI key needed"
31
+ REFRESH_MSG = "Please refresh and hit 'Click to wake up MM-REACT'"
32
  MAX_TOKENS = 512
33
 
34
 
 
369
  # multi line response handling
370
  def process_chain_output(outputs):
371
  global ARGS
372
+ EMPTY_AI_REPLY = "AI:"
373
  # print("outputs {}".format(outputs))
374
  if isinstance(outputs, str): # single line output
375
+ if outputs.strip() == EMPTY_AI_REPLY:
376
+ outputs = REFRESH_MSG
377
  outputs = [outputs]
378
  elif isinstance(outputs, list): # multi line output
379
  if ARGS.noIntermediateConv: # remove the items with assistant in it.
380
  cleanOutputs = []
381
  for output in outputs:
382
+ if output.strip() == EMPTY_AI_REPLY:
383
+ output = REFRESH_MSG
384
  # found an edited image url to embed
385
  img_url = None
386
  # print ("type list: {}".format(output))
 
403
  chat = ChatWrapper()
404
 
405
  exampleTitle = """<h3>Examples to start conversation..</h3>"""
406
+ comingSoon = """<center><b><p style="color:Red;">MMREACT: March 21th version with image understanding capabilities</p></b></center>"""
407
 
408
  with gr.Blocks(css="#tryButton {width: 120px;}") as block:
409
  llm_state = gr.State()
 
412
  log_state = gr.State()
413
 
414
  reset_btn = gr.Button(value="!!!CLICK to wake up MM-REACT!!!", variant="primary", elem_id="resetbtn").style(full_width=True)
415
+ gr.HTML(comingSoon)
416
 
417
  example_image_size = 90
418
  col_min_width = 80
 
439
  example1ImagePath = gr.Text("images/money.png", interactive=False, visible=False)
440
  with gr.Row():
441
  with gr.Column(scale=0.50, min_width=col_min_width):
442
+ example2Image = gr.Image("images/cartoon.png", interactive=False).style(height=example_image_size, width=example_image_size)
443
  with gr.Column(scale=0.50, min_width=col_min_width):
444
  example2ImageButton = gr.Button(elem_id="tryButton", value="Try it!", variant=button_variant).style(full_width=True)
445
  # dummy text field to hold the path
446
+ example2ImagePath = gr.Text("images/cartoon.png", interactive=False, visible=False)
447
  with gr.Row():
448
  with gr.Column(scale=0.50, min_width=col_min_width):
449
+ example4Image = gr.Image("images/product.png", interactive=False).style(height=example_image_size, width=example_image_size)
450
  with gr.Column(scale=0.50, min_width=col_min_width):
451
  example4ImageButton = gr.Button(elem_id="tryButton", value="Try it!", variant=button_variant).style(full_width=True)
452
  # dummy text field to hold the path
453
+ example4ImagePath = gr.Text("images/product.png", interactive=False, visible=False)
454
  with gr.Row():
455
  with gr.Column(scale=0.50, min_width=col_min_width):
456
+ example5Image = gr.Image("images/celebrity.png", interactive=False).style(height=example_image_size, width=example_image_size)
457
  with gr.Column(scale=0.50, min_width=col_min_width):
458
  example5ImageButton = gr.Button(elem_id="tryButton", value="Try it!", variant=button_variant).style(full_width=True)
459
  # dummy text field to hold the path
460
+ example5ImagePath = gr.Text("images/celebrity.png", interactive=False, visible=False)
461
+
462
 
463
 
464
  with gr.Row():
 
502
  global ARGS
503
  ARGS = parser.parse_args()
504
 
505
+ init_and_kick_off()
 
MM-REACT/images/cartoon.png ADDED

Git LFS Details

  • SHA256: 21802525f0fa269131e78c5ac55d150bdd6cb728a473b09a871e28a02c5dd123
  • Pointer size: 132 Bytes
  • Size of remote file: 1.06 MB
MM-REACT/images/celebrity.png ADDED

Git LFS Details

  • SHA256: 9c60f49627655d70c76ff0106f61412db1735cad1820ed1b87f9ca7e287d9763
  • Pointer size: 132 Bytes
  • Size of remote file: 2.24 MB
MM-REACT/images/money.png CHANGED

Git LFS Details

  • SHA256: 0c7f6155049624573c2852538c86ffaab41c258f04462d0f9dc1b73b86949030
  • Pointer size: 131 Bytes
  • Size of remote file: 763 kB
MM-REACT/images/product.png ADDED

Git LFS Details

  • SHA256: b6bd4efae45dadf27cd9b960a56aded711d0c8ec3e41ae0012eb8dd0c8c92ceb
  • Pointer size: 131 Bytes
  • Size of remote file: 655 kB
MM-REACT/images/receipt.png CHANGED

Git LFS Details

  • SHA256: 86a1c65f0e82c855cbd766178fe9080fe9c084678da79f2e695680c0ee97b9eb
  • Pointer size: 131 Bytes
  • Size of remote file: 656 kB