Spaces:
Sleeping
Sleeping
Update module_vision.py
Browse files- module_vision.py +10 -7
module_vision.py
CHANGED
@@ -14,11 +14,14 @@ def process(message, history):
|
|
14 |
messages = vlm.build_messages(message, history)
|
15 |
yield from vlm.stream_response(messages)
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
22 |
|
23 |
#
|
24 |
# User interface
|
@@ -26,8 +29,8 @@ def process(message, history):
|
|
26 |
with gr.Blocks() as demo:
|
27 |
chat_interface = gr.ChatInterface(
|
28 |
fn=process,
|
29 |
-
description="Chat with text
|
30 |
-
|
31 |
#cache_examples=False,
|
32 |
stop_btn="Stop Generation",
|
33 |
multimodal=True,
|
|
|
14 |
messages = vlm.build_messages(message, history)
|
15 |
yield from vlm.stream_response(messages)
|
16 |
|
17 |
+
examples=[
|
18 |
+
{
|
19 |
+
'files': ['./passport_jp.png',],
|
20 |
+
'text': 'Can you describe the image and present the information as a JSON document?'
|
21 |
+
},
|
22 |
+
{'text': 'How can we rationalize quantum entanglement?'},
|
23 |
+
{'text': "Peux-tu expliquer le terme 'quantum spin'?"}
|
24 |
+
]
|
25 |
|
26 |
#
|
27 |
# User interface
|
|
|
29 |
with gr.Blocks() as demo:
|
30 |
chat_interface = gr.ChatInterface(
|
31 |
fn=process,
|
32 |
+
description="Chat with text or text+image.",
|
33 |
+
examples=examples,
|
34 |
#cache_examples=False,
|
35 |
stop_btn="Stop Generation",
|
36 |
multimodal=True,
|