Leyo commited on
Commit
f9f9d0b
1 Parent(s): 016ec10
Files changed (1) hide show
  1. app_dialogue.py +59 -49
app_dialogue.py CHANGED
@@ -85,57 +85,67 @@ PROCESSOR = AutoProcessor.from_pretrained(
85
 
86
  SYSTEM_PROMPT = [
87
  {
88
- "role": "user",
89
  "content": [
90
- {"type": "image", "image": "https://huggingface.co/spaces/HuggingFaceM4/idefics_playground/resolve/main/example_images/kittens-cats-pet-cute-preview.jpg?download=true"},
91
- {"type": "text", "text": "Describe this image."},
 
 
 
92
  ],
93
- },
94
- {
95
- "role": "assistant",
96
- "content": [
97
- {"type": "text", "text": "Five kittens are standing together in the center of the photograph. From the left to right, there is one orange kitten, two kittens white and black stripes, and two brown kittens with an orange head. They are in bright green grass and it looks like they are moving forward."},
98
- ],
99
- },
100
- {
101
- "role": "user",
102
- "content": [
103
- {"type": "text", "text": "How about this image?"},
104
- {"type": "image", "image": "https://huggingface.co/spaces/HuggingFaceM4/idefics_playground/resolve/main/example_images/puppy.jpg?download=true"},
105
- {"type": "text", "text": "Can you describe it too?"},
106
- ],
107
- },
108
- {
109
- "role": "assistant",
110
- "content": [
111
- {"type": "text", "text": "A dog is lying on the floor, looking at the camera. It is looking directly at you. The dog has a white body and brown patches on its face and ears. Its eyes are dark. Its nose is black, and it has long, floppy ears, white paws, long fur, big eyes."},
112
- ],
113
- },
114
- {
115
- "role": "user",
116
- "content": [
117
- {"type": "text", "text": "What can you tell me about this breed of dogs?"},
118
- ],
119
- },
120
- {
121
- "role": "assistant",
122
- "content": [
123
- {"type": "text", "text": "One specific characteristic of the Cavalier King Charles Spaniel is its friendly and affectionate nature. This breed is known for being extremely sociable and forming strong bonds with their owners. They are often described as \"velcro dogs\" because they love to be close to their human companions, whether it's sitting on their laps, cuddling on the couch, or simply following them around the house."},
124
- ],
125
- },
126
- {
127
- "role": "user",
128
- "content": [
129
- {"type": "text", "text": "How many dogs do you see in the following image?"},
130
- {"type": "image", "image": "https://huggingface.co/spaces/HuggingFaceM4/idefics_playground/resolve/main/example_images/tennis_tsonga.jpg?download=true"},
131
- ],
132
- },
133
- {
134
- "role": "assistant",
135
- "content": [
136
- {"type": "text", "text": "There are no dogs in this image. The picture shows a tennis player in the midst of a powerful swing."},
137
- ],
138
- },
 
 
 
 
 
 
 
139
  ]
140
 
141
 
 
85
 
86
  SYSTEM_PROMPT = [
87
  {
88
+ "role": "system",
89
  "content": [
90
+ {"type": "text", "text":
91
+ "The following is a conversation between a highly knowledgeable and intelligent visual AI assistant, called Assistant, and a human user, called User. In the following interactions, \
92
+ User and Assistant will converse in natural language, and Assistant will do its best to answer User’s questions. Assistant has the ability to perceive images and reason about the \
93
+ content of visual inputs. Assistant was built to be respectful, polite and inclusive. It knows a lot, and always tells the truth. When prompted with an image, it does not make up facts."
94
+ },
95
  ],
96
+ }
97
+ # {
98
+ # "role": "user",
99
+ # "content": [
100
+ # {"type": "image", "image": "https://huggingface.co/spaces/HuggingFaceM4/idefics_playground/resolve/main/example_images/kittens-cats-pet-cute-preview.jpg?download=true"},
101
+ # {"type": "text", "text": "Describe this image."},
102
+ # ],
103
+ # },
104
+ # {
105
+ # "role": "assistant",
106
+ # "content": [
107
+ # {"type": "text", "text": "Five kittens are standing together in the center of the photograph. From the left to right, there is one orange kitten, two kittens white and black stripes, and two brown kittens with an orange head. They are in bright green grass and it looks like they are moving forward."},
108
+ # ],
109
+ # },
110
+ # {
111
+ # "role": "user",
112
+ # "content": [
113
+ # {"type": "text", "text": "How about this image?"},
114
+ # {"type": "image", "image": "https://huggingface.co/spaces/HuggingFaceM4/idefics_playground/resolve/main/example_images/puppy.jpg?download=true"},
115
+ # {"type": "text", "text": "Can you describe it too?"},
116
+ # ],
117
+ # },
118
+ # {
119
+ # "role": "assistant",
120
+ # "content": [
121
+ # {"type": "text", "text": "A dog is lying on the floor, looking at the camera. It is looking directly at you. The dog has a white body and brown patches on its face and ears. Its eyes are dark. Its nose is black, and it has long, floppy ears, white paws, long fur, big eyes."},
122
+ # ],
123
+ # },
124
+ # {
125
+ # "role": "user",
126
+ # "content": [
127
+ # {"type": "text", "text": "What can you tell me about this breed of dogs?"},
128
+ # ],
129
+ # },
130
+ # {
131
+ # "role": "assistant",
132
+ # "content": [
133
+ # {"type": "text", "text": "One specific characteristic of the Cavalier King Charles Spaniel is its friendly and affectionate nature. This breed is known for being extremely sociable and forming strong bonds with their owners. They are often described as \"velcro dogs\" because they love to be close to their human companions, whether it's sitting on their laps, cuddling on the couch, or simply following them around the house."},
134
+ # ],
135
+ # },
136
+ # {
137
+ # "role": "user",
138
+ # "content": [
139
+ # {"type": "text", "text": "How many dogs do you see in the following image?"},
140
+ # {"type": "image", "image": "https://huggingface.co/spaces/HuggingFaceM4/idefics_playground/resolve/main/example_images/tennis_tsonga.jpg?download=true"},
141
+ # ],
142
+ # },
143
+ # {
144
+ # "role": "assistant",
145
+ # "content": [
146
+ # {"type": "text", "text": "There are no dogs in this image. The picture shows a tennis player in the midst of a powerful swing."},
147
+ # ],
148
+ # },
149
  ]
150
 
151