Rocketknight1 HF staff commited on
Commit
7f5b217
1 Parent(s): ff8295e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +46 -19
README.md CHANGED
@@ -26,7 +26,36 @@ generate_ids = model.generate(**inputs, max_new_tokens=500)
26
  output = processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
27
  ```
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  You can also use a chat template to format your chat history for Pixtral. Here's an example - note how you can interleave text and multiple images in the same message!
 
 
30
 
31
  ```python
32
  from PIL import Image
@@ -55,29 +84,27 @@ generate_ids = model.generate(**inputs, max_new_tokens=500)
55
  output = processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
56
  ```
57
 
58
- I got something like this:
 
59
  ```
 
60
 
61
- """
62
- Describe the images.
63
- Sure, let's break down each image description:
 
64
 
65
- 1. **Image 1:**
66
- - **Description:** A black dog with a glossy coat is sitting on a wooden floor. The dog has a focused expression and is looking directly at the camera.
67
- - **Details:** The wooden floor has a rustic appearance with visible wood grain patterns. The dog's eyes are a striking color, possibly brown or amber, which contrasts with its black fur.
 
68
 
69
- 2. **Image 2:**
70
- - **Description:** A scenic view of a mountainous landscape with a winding road cutting through it. The road is surrounded by lush green vegetation and leads to a distant valley.
71
- - **Details:** The mountains are rugged with steep slopes, and the sky is clear, indicating good weather. The winding road adds a sense of depth and perspective to the image.
72
 
73
- 3. **Image 3:**
74
- - **Description:** A beach scene with waves crashing against the shore. There are several people in the water and on the beach, enjoying the waves and the sunset.
75
- - **Details:** The waves are powerful, creating a dynamic and lively atmosphere. The sky is painted with hues of orange and pink from the setting sun, adding a warm glow to the scene.
76
 
77
- 4. **Image 4:**
78
- - **Description:** A garden path leading to a large tree with a bench underneath it. The path is bordered by well-maintained grass and flowers.
79
- - **Details:** The path is made of small stones or gravel, and the tree provides a shaded area with the bench invitingly placed beneath it. The surrounding area is lush and green, suggesting a well-kept garden.
80
 
81
- Each image captures a different scene, from a close-up of a dog to expansive natural landscapes, showcasing various elements of nature and human interaction with it.
82
- """
83
- ```
 
26
  output = processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
27
  ```
28
 
29
+ You should get an output similar to the below:
30
+ ```
31
+
32
+ """
33
+ Describe the images.
34
+ Sure, let's break down each image description:
35
+
36
+ 1. **Image 1:**
37
+ - **Description:** A black dog with a glossy coat is sitting on a wooden floor. The dog has a focused expression and is looking directly at the camera.
38
+ - **Details:** The wooden floor has a rustic appearance with visible wood grain patterns. The dog's eyes are a striking color, possibly brown or amber, which contrasts with its black fur.
39
+
40
+ 2. **Image 2:**
41
+ - **Description:** A scenic view of a mountainous landscape with a winding road cutting through it. The road is surrounded by lush green vegetation and leads to a distant valley.
42
+ - **Details:** The mountains are rugged with steep slopes, and the sky is clear, indicating good weather. The winding road adds a sense of depth and perspective to the image.
43
+
44
+ 3. **Image 3:**
45
+ - **Description:** A beach scene with waves crashing against the shore. There are several people in the water and on the beach, enjoying the waves and the sunset.
46
+ - **Details:** The waves are powerful, creating a dynamic and lively atmosphere. The sky is painted with hues of orange and pink from the setting sun, adding a warm glow to the scene.
47
+
48
+ 4. **Image 4:**
49
+ - **Description:** A garden path leading to a large tree with a bench underneath it. The path is bordered by well-maintained grass and flowers.
50
+ - **Details:** The path is made of small stones or gravel, and the tree provides a shaded area with the bench invitingly placed beneath it. The surrounding area is lush and green, suggesting a well-kept garden.
51
+
52
+ Each image captures a different scene, from a close-up of a dog to expansive natural landscapes, showcasing various elements of nature and human interaction with it.
53
+ """
54
+ ```
55
+
56
  You can also use a chat template to format your chat history for Pixtral. Here's an example - note how you can interleave text and multiple images in the same message!
57
+ Make sure that the `images` argument to the `processor` contains the images in the order that they appear in the chat, so that the model understands where
58
+ each image is supposed to go.
59
 
60
  ```python
61
  from PIL import Image
 
84
  output = processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
85
  ```
86
 
87
+ You should get something like this:
88
+
89
  ```
90
+ Can this animallive here?Certainly! Here are some details about the images you provided:
91
 
92
+ ### First Image
93
+ - **Description**: The image shows a black dog lying on a wooden surface. The dog has a curious expression with its head tilted slightly to one side.
94
+ - **Details**: The dog appears to be a young puppy with soft, shiny fur. Its eyes are wide and alert, and it has a playful demeanor.
95
+ - **Context**: This image could be used to illustrate a pet-friendly environment or to showcase the dog's personality.
96
 
97
+ ### Second Image
98
+ - **Description**: The image depicts a serene landscape with a snow-covered hill in the foreground. The sky is painted with soft hues of pink, orange, and purple, indicating a sunrise or sunset.
99
+ - **Details**: The hill is covered in a blanket of pristine white snow, and the horizon meets the sky in a gentle curve. The scene is calm and peaceful.
100
+ - **Context**: This image could be used to represent tranquility, natural beauty, or a winter wonderland.
101
 
102
+ ### Combined Context
103
+ If you're asking whether the dog can "live here," referring to the snowy landscape, it would depend on the breed and its tolerance to cold weather. Some breeds, like Huskies or Saint Bernards, are well-adapted to cold environments, while others might struggle. The dog in the first image appears to be a breed that might prefer warmer climates.
 
104
 
105
+ Would you like more information on any specific aspect?
106
+ ```
 
107
 
108
+ Note that while it may appear that spacing in the input is disrupted, this is caused by us skipping special tokens for display, and actually "Can this animal" and "live here" are
109
+ correctly separated by image tokens. Try decoding with special tokens included to see exactly what the model sees!
 
110