Himetsu commited on
Commit
e32103d
1 Parent(s): 4434ab1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +47 -1
README.md CHANGED
@@ -4,4 +4,50 @@ tags: []
4
  ---
5
 
6
  # Model Card for Model ID
7
- Transformers compatible pixtral checkpoints
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  ---
5
 
6
  # Model Card for Model ID
7
+ Transformers compatible pixtral checkpoints.
8
+
9
+ How to use:
10
+ ```python
11
+ from transformers import AutoProcessor, AutoModelForConditionalGeneration
12
+ model_id = "Himetsu/pixtral-12b"
13
+ model = LlavaForConditionalGeneration.from_pretrained(model_id, load_in_4bit=True)
14
+ processor = AutoProcessor.from_pretrained(model_id)
15
+
16
+ IMG_URLS = [
17
+ Image.open(requests.get("https://picsum.photos/id/237/400/300", stream=True).raw),
18
+ Image.open(requests.get("https://picsum.photos/id/231/200/300", stream=True).raw),
19
+ Image.open(requests.get("https://picsum.photos/id/27/500/500", stream=True).raw),
20
+ Image.open(requests.get("https://picsum.photos/id/17/150/600", stream=True).raw),
21
+ ]
22
+ PROMPT = "<s>[INST]Describe the images.\n[IMG][IMG][IMG][IMG][/INST]"
23
+
24
+ inputs = processor(text=PROMPT, images=IMG_URLS, return_tensors="pt").to("cuda")
25
+ generate_ids = model.generate(**inputs, max_new_tokens=500)
26
+ ouptut = processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
27
+ ```
28
+ I got something like this:
29
+ ```
30
+
31
+ """
32
+ Describe the images.
33
+ Sure, let's break down each image description:
34
+
35
+ 1. **Image 1:**
36
+ - **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.
37
+ - **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.
38
+
39
+ 2. **Image 2:**
40
+ - **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.
41
+ - **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.
42
+
43
+ 3. **Image 3:**
44
+ - **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.
45
+ - **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.
46
+
47
+ 4. **Image 4:**
48
+ - **Description:** A garden path leading to a large tree with a bench underneath it. The path is bordered by well-maintained grass and flowers.
49
+ - **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.
50
+
51
+ 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.
52
+ """
53
+ ```