ahmedheakl commited on
Commit
484618d
·
verified ·
1 Parent(s): 2ed6ee8

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. data.json +1 -40
  2. gradio_app.py +1 -1
data.json CHANGED
@@ -1,40 +1 @@
1
- [
2
- {
3
- "role": "user",
4
- "content": [
5
- {
6
- "type": "image_url",
7
- "image_url": {
8
- "url": "https: //ahmedheakl-AIN-Arabic-VLM.hf.space/gradio_api/file=/tmp/gradio/c0e5b4df2409e7ed8f979c038edbfaee2eb36ea690b741e240f2072d60c34354/Arab-Muslim-or-Middle-Eastern-Preview.jpg"
9
- }
10
- }
11
- ]
12
- },
13
- {
14
- "role": "user",
15
- "content": [
16
- {
17
- "type": "text",
18
- "text": "How many people are there in the image?"
19
- }
20
- ]
21
- },
22
- {
23
- "role": "assistant",
24
- "content": [
25
- {
26
- "type": "text",
27
- "text": "There are five people in the image. The family consists of a mother, father, young son, grandfather, and an adult son. They are all seated together on a blue couch, dressed in traditional Middle Eastern attire."
28
- }
29
- ]
30
- },
31
- {
32
- "role": "user",
33
- "content": [
34
- {
35
- "type": "text",
36
- "text": "hello"
37
- }
38
- ]
39
- }
40
- ]
 
1
+ [{"role": "user", "content": [{"type": "image_url", "image_url": {"url": "https://ahmedheakl-AIN-Arabic-VLM.hf.space/gradio_api/file=/tmp/gradio/52590fe988d8267763f3f0cd7f88914872f8638358112da9fd6204b405f0db49/Arab-Muslim-or-Middle-Eastern-Preview.jpg"}}, [{"type": "text", "text": "How many people are there in the image?"}]]}, {"role": "assistant", "content": [{"type": "text", "text": "There are five people in the image. The family consists of a mother, father, son, grandfather, and an adult son. They are all seated together on a green couch, posing for a photograph."}]}, {"role": "user", "content": [{"type": "text", "text": "hello"}]}]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
gradio_app.py CHANGED
@@ -48,7 +48,7 @@ def load_chat(
48
  else:
49
  ct = [{"type": "text", "text": content}]
50
  if merge:
51
- hist[-1]["content"].append(ct)
52
  merge = False
53
  else:
54
  hist.append({"role": role, "content": ct})
 
48
  else:
49
  ct = [{"type": "text", "text": content}]
50
  if merge:
51
+ hist[-1]["content"].extend(ct)
52
  merge = False
53
  else:
54
  hist.append({"role": role, "content": ct})