DongfuJiang commited on
Commit
9bda08e
1 Parent(s): fcbc2b1
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. app.py +3 -3
  2. examples/1006309/1006309_00.jpg +0 -0
  3. examples/1006309/1006309_01.jpg +0 -0
  4. examples/1006309/1006309_02.jpg +0 -0
  5. examples/1006309/1006309_03.jpg +0 -0
  6. examples/1006309/1006309_04.jpg +0 -0
  7. examples/1006309/1006309_05.jpg +0 -0
  8. examples/1006309/1006309_06.jpg +0 -0
  9. examples/1006309/1006309_07.jpg +0 -0
  10. examples/1006309/1006309_08.jpg +0 -0
  11. examples/1006309/1006309_09.jpg +0 -0
  12. examples/1006309/1006309_10.jpg +0 -0
  13. examples/1006309/1006309_11.jpg +0 -0
  14. examples/1006309/1006309_12.jpg +0 -0
  15. examples/1006309/1006309_13.jpg +0 -0
  16. examples/1006309/1006309_14.jpg +0 -0
  17. examples/1006309/1006309_15.jpg +0 -0
  18. examples/3005033/3005033_00.jpg +0 -0
  19. examples/3005033/3005033_01.jpg +0 -0
  20. examples/3005033/3005033_02.jpg +0 -0
  21. examples/3005033/3005033_03.jpg +0 -0
  22. examples/3005033/3005033_04.jpg +0 -0
  23. examples/3005033/3005033_05.jpg +0 -0
  24. examples/3005033/3005033_06.jpg +0 -0
  25. examples/3005033/3005033_07.jpg +0 -0
  26. examples/3005033/3005033_08.jpg +0 -0
  27. examples/3005033/3005033_09.jpg +0 -0
  28. examples/3005033/3005033_10.jpg +0 -0
  29. examples/3005033/3005033_11.jpg +0 -0
  30. examples/3005033/3005033_12.jpg +0 -0
  31. examples/3005033/3005033_13.jpg +0 -0
  32. examples/3005033/3005033_14.jpg +0 -0
  33. examples/3005033/3005033_15.jpg +0 -0
  34. examples/7004180/7004180_00.jpg +0 -0
  35. examples/7004180/7004180_01.jpg +0 -0
  36. examples/7004180/7004180_02.jpg +0 -0
  37. examples/7004180/7004180_03.jpg +0 -0
  38. examples/7004180/7004180_04.jpg +0 -0
  39. examples/7004180/7004180_05.jpg +0 -0
  40. examples/7004180/7004180_06.jpg +0 -0
  41. examples/7004180/7004180_07.jpg +0 -0
  42. examples/a400480/a400480_00.jpg +0 -0
  43. examples/a400480/a400480_01.jpg +0 -0
  44. examples/a400480/a400480_02.jpg +0 -0
  45. examples/a400480/a400480_03.jpg +0 -0
  46. examples/a400480/a400480_04.jpg +0 -0
  47. examples/a400480/a400480_05.jpg +0 -0
  48. examples/a400480/a400480_06.jpg +0 -0
  49. examples/a400480/a400480_07.jpg +0 -0
  50. examples/a400480/a400480_08.jpg +0 -0
app.py CHANGED
@@ -12,7 +12,7 @@ processor = AutoProcessor.from_pretrained("MFuyu/mantis-8b-idefics2-video-eval_8
12
  model = Idefics2ForConditionalGeneration.from_pretrained("MFuyu/mantis-8b-idefics2-video-eval_8192_lora")
13
  conv_template = conv_templates["idefics_2"]
14
 
15
- with open("./examples/data_subset.json", 'r') as f:
16
  examples = json.load(f)
17
 
18
  for item in examples:
@@ -153,7 +153,8 @@ def bot(history):
153
  }
154
 
155
  response = generate(None, chat_images, chat_history, **generation_kwargs)
156
- return response
 
157
  # for _output in response:
158
  # history[-1][1] = _output
159
  # time.sleep(0.05)
@@ -183,7 +184,6 @@ Mantis is a multimodal conversational AI model that can chat with users about im
183
  gr.Markdown("""## Chat with Mantis
184
  Mantis supports interleaved text-image input format, where you can simply use the placeholder `<image>` to indicate the position of uploaded images.
185
  The model is optimized for multi-image reasoning, while preserving the ability to chat about text and images in a single conversation.
186
- (The model currently serving is [🤗 TIGER-Lab/Mantis-8B-siglip-llama3](https://huggingface.co/TIGER-Lab/Mantis-8B-siglip-llama3))
187
  """)
188
 
189
  chatbot = gr.Chatbot(line_breaks=True)
 
12
  model = Idefics2ForConditionalGeneration.from_pretrained("MFuyu/mantis-8b-idefics2-video-eval_8192_lora")
13
  conv_template = conv_templates["idefics_2"]
14
 
15
+ with open("./examples/all_subsets.json", 'r') as f:
16
  examples = json.load(f)
17
 
18
  for item in examples:
 
153
  }
154
 
155
  response = generate(None, chat_images, chat_history, **generation_kwargs)
156
+ history[-1][1] = response
157
+ return history
158
  # for _output in response:
159
  # history[-1][1] = _output
160
  # time.sleep(0.05)
 
184
  gr.Markdown("""## Chat with Mantis
185
  Mantis supports interleaved text-image input format, where you can simply use the placeholder `<image>` to indicate the position of uploaded images.
186
  The model is optimized for multi-image reasoning, while preserving the ability to chat about text and images in a single conversation.
 
187
  """)
188
 
189
  chatbot = gr.Chatbot(line_breaks=True)
examples/1006309/1006309_00.jpg ADDED
examples/1006309/1006309_01.jpg ADDED
examples/1006309/1006309_02.jpg ADDED
examples/1006309/1006309_03.jpg ADDED
examples/1006309/1006309_04.jpg ADDED
examples/1006309/1006309_05.jpg ADDED
examples/1006309/1006309_06.jpg ADDED
examples/1006309/1006309_07.jpg ADDED
examples/1006309/1006309_08.jpg ADDED
examples/1006309/1006309_09.jpg ADDED
examples/1006309/1006309_10.jpg ADDED
examples/1006309/1006309_11.jpg ADDED
examples/1006309/1006309_12.jpg ADDED
examples/1006309/1006309_13.jpg ADDED
examples/1006309/1006309_14.jpg ADDED
examples/1006309/1006309_15.jpg ADDED
examples/3005033/3005033_00.jpg ADDED
examples/3005033/3005033_01.jpg ADDED
examples/3005033/3005033_02.jpg ADDED
examples/3005033/3005033_03.jpg ADDED
examples/3005033/3005033_04.jpg ADDED
examples/3005033/3005033_05.jpg ADDED
examples/3005033/3005033_06.jpg ADDED
examples/3005033/3005033_07.jpg ADDED
examples/3005033/3005033_08.jpg ADDED
examples/3005033/3005033_09.jpg ADDED
examples/3005033/3005033_10.jpg ADDED
examples/3005033/3005033_11.jpg ADDED
examples/3005033/3005033_12.jpg ADDED
examples/3005033/3005033_13.jpg ADDED
examples/3005033/3005033_14.jpg ADDED
examples/3005033/3005033_15.jpg ADDED
examples/7004180/7004180_00.jpg ADDED
examples/7004180/7004180_01.jpg ADDED
examples/7004180/7004180_02.jpg ADDED
examples/7004180/7004180_03.jpg ADDED
examples/7004180/7004180_04.jpg ADDED
examples/7004180/7004180_05.jpg ADDED
examples/7004180/7004180_06.jpg ADDED
examples/7004180/7004180_07.jpg ADDED
examples/a400480/a400480_00.jpg ADDED
examples/a400480/a400480_01.jpg ADDED
examples/a400480/a400480_02.jpg ADDED
examples/a400480/a400480_03.jpg ADDED
examples/a400480/a400480_04.jpg ADDED
examples/a400480/a400480_05.jpg ADDED
examples/a400480/a400480_06.jpg ADDED
examples/a400480/a400480_07.jpg ADDED
examples/a400480/a400480_08.jpg ADDED