Leyo commited on
Commit
0113778
1 Parent(s): 742ceb6

try system prompt

Browse files
Files changed (1) hide show
  1. app_dialogue.py +33 -2
app_dialogue.py CHANGED
@@ -42,8 +42,8 @@ PROCESSOR = AutoProcessor.from_pretrained(
42
  token=os.environ["HF_AUTH_TOKEN"],
43
  )
44
 
45
- SYSTEM_PROMPT = [ # Deactivating the system propmpt for now, but if I were to reactivate it, I would need to a/ transform turns into dict for applying the chat template, b/ manually overwrite the `default_template` to add the first line (that is not part of any turns), in particular for handling the bos_token.
46
- # """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, 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 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.
47
 
48
  # The conversation begins:""",
49
  # """\nUser:""",
@@ -66,8 +66,39 @@ SYSTEM_PROMPT = [ # Deactivating the system propmpt for now, but if I were to re
66
  # "https://i.dailymail.co.uk/i/pix/2011/07/01/article-2010308-0CD22A8300000578-496_634x414.jpg",
67
  # "<end_of_utterance>",
68
  # """\nAssistant: There is no dogs in this image. The picture shows a tennis player jumping to volley the ball.<end_of_utterance>""",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  ]
70
 
 
71
  API_TOKEN = os.getenv("HF_AUTH_TOKEN")
72
  # IDEFICS_LOGO = "https://huggingface.co/spaces/HuggingFaceM4/idefics_playground/resolve/main/IDEFICS_logo.png"
73
  BOT_AVATAR = "IDEFICS_logo.png"
 
42
  token=os.environ["HF_AUTH_TOKEN"],
43
  )
44
 
45
+ # SYSTEM_PROMPT = [ # Deactivating the system propmpt for now, but if I were to reactivate it, I would need to a/ transform turns into dict for applying the chat template, b/ manually overwrite the `default_template` to add the first line (that is not part of any turns), in particular for handling the bos_token.
46
+ # # """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, 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 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.
47
 
48
  # The conversation begins:""",
49
  # """\nUser:""",
 
66
  # "https://i.dailymail.co.uk/i/pix/2011/07/01/article-2010308-0CD22A8300000578-496_634x414.jpg",
67
  # "<end_of_utterance>",
68
  # """\nAssistant: There is no dogs in this image. The picture shows a tennis player jumping to volley the ball.<end_of_utterance>""",
69
+ # ]
70
+
71
+ SYSTEM_PROMPT = [
72
+ {
73
+ "role": "user",
74
+ "content": [
75
+ {"type": "image", "image": "https://i1.pickpik.com/photos/515/906/355/kittens-cats-pet-cute-preview.jpg"},
76
+ {"type": "text", "text": "Describe this image."},
77
+ ],
78
+ },
79
+ {
80
+ "role": "assistant",
81
+ "content": [
82
+ {"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."},
83
+ ],
84
+ },
85
+ {
86
+ "role": "user",
87
+ "content": [
88
+ {"type": "text", "text": "How about this image?"},
89
+ {"type": "image", "image": "https://cdn.pixabay.com/photo/2017/09/25/13/12/puppy-2785074_1280.jpg"},
90
+ {"type": "text", "text": "Can you describe it too?"},
91
+ ],
92
+ },
93
+ {
94
+ "role": "assistant",
95
+ "content": [
96
+ {"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."},
97
+ ],
98
+ },
99
  ]
100
 
101
+
102
  API_TOKEN = os.getenv("HF_AUTH_TOKEN")
103
  # IDEFICS_LOGO = "https://huggingface.co/spaces/HuggingFaceM4/idefics_playground/resolve/main/IDEFICS_logo.png"
104
  BOT_AVATAR = "IDEFICS_logo.png"