Spaces:
Runtime error
Runtime error
DongfuJiang
commited on
Commit
•
9bda08e
1
Parent(s):
fcbc2b1
update
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- app.py +3 -3
- examples/1006309/1006309_00.jpg +0 -0
- examples/1006309/1006309_01.jpg +0 -0
- examples/1006309/1006309_02.jpg +0 -0
- examples/1006309/1006309_03.jpg +0 -0
- examples/1006309/1006309_04.jpg +0 -0
- examples/1006309/1006309_05.jpg +0 -0
- examples/1006309/1006309_06.jpg +0 -0
- examples/1006309/1006309_07.jpg +0 -0
- examples/1006309/1006309_08.jpg +0 -0
- examples/1006309/1006309_09.jpg +0 -0
- examples/1006309/1006309_10.jpg +0 -0
- examples/1006309/1006309_11.jpg +0 -0
- examples/1006309/1006309_12.jpg +0 -0
- examples/1006309/1006309_13.jpg +0 -0
- examples/1006309/1006309_14.jpg +0 -0
- examples/1006309/1006309_15.jpg +0 -0
- examples/3005033/3005033_00.jpg +0 -0
- examples/3005033/3005033_01.jpg +0 -0
- examples/3005033/3005033_02.jpg +0 -0
- examples/3005033/3005033_03.jpg +0 -0
- examples/3005033/3005033_04.jpg +0 -0
- examples/3005033/3005033_05.jpg +0 -0
- examples/3005033/3005033_06.jpg +0 -0
- examples/3005033/3005033_07.jpg +0 -0
- examples/3005033/3005033_08.jpg +0 -0
- examples/3005033/3005033_09.jpg +0 -0
- examples/3005033/3005033_10.jpg +0 -0
- examples/3005033/3005033_11.jpg +0 -0
- examples/3005033/3005033_12.jpg +0 -0
- examples/3005033/3005033_13.jpg +0 -0
- examples/3005033/3005033_14.jpg +0 -0
- examples/3005033/3005033_15.jpg +0 -0
- examples/7004180/7004180_00.jpg +0 -0
- examples/7004180/7004180_01.jpg +0 -0
- examples/7004180/7004180_02.jpg +0 -0
- examples/7004180/7004180_03.jpg +0 -0
- examples/7004180/7004180_04.jpg +0 -0
- examples/7004180/7004180_05.jpg +0 -0
- examples/7004180/7004180_06.jpg +0 -0
- examples/7004180/7004180_07.jpg +0 -0
- examples/a400480/a400480_00.jpg +0 -0
- examples/a400480/a400480_01.jpg +0 -0
- examples/a400480/a400480_02.jpg +0 -0
- examples/a400480/a400480_03.jpg +0 -0
- examples/a400480/a400480_04.jpg +0 -0
- examples/a400480/a400480_05.jpg +0 -0
- examples/a400480/a400480_06.jpg +0 -0
- examples/a400480/a400480_07.jpg +0 -0
- 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/
|
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 |
-
|
|
|
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