File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 58
58
run : |
59
59
python3 -m pip cache dir
60
60
python3 -m pip install --upgrade pip setuptools==69.5.1
61
- python3 -m pip install torch==2.5.1 torchvision==0.20.1
61
+ python3 -m pip install torch==2.6.0 torchvision==0.21.0
62
62
# the install packeage from. https://github.com/Dao-AILab/flash-attention/releases
63
- python3 -m pip install /root/packages/flash_attn-2.6.3+cu123torch2.3cxx11abiFALSE -cp310-cp310-linux_x86_64.whl
63
+ python3 -m pip install /root/packages/flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE -cp310-cp310-linux_x86_64.whl
64
64
- name : Build lmdeploy
65
65
run : |
66
66
cp /nvme/qa_test_models/offline_pkg/openmpi-4.1.5.tar.gz .
Original file line number Diff line number Diff line change @@ -74,11 +74,20 @@ def preprocess(self, messages: List[Dict]) -> List[Dict]:
74
74
)
75
75
images = self .collect_images (messages )
76
76
images = [image .convert ('RGB' ) for image , _ in images ]
77
+ num_image = len (images )
77
78
images = make_nested_list_of_images (images )
78
79
image_inputs = self .processor .image_processor (images , ** output_kwargs ['images_kwargs' ])
79
- image_inputs ['image_tokens' ] = self .image_tokens
80
- image_inputs ['image_token_id' ] = self .image_token_id
81
- messages .append (dict (role = 'preprocess' , content = [image_inputs ]))
80
+ outputs = []
81
+ for idx in range (num_image ):
82
+ pixel_values = image_inputs ['pixel_values' ][idx :idx + 1 , ...]
83
+ num_crops = image_inputs ['num_crops' ][:idx :idx + 1 ]
84
+ data = dict (pixel_values = pixel_values ,
85
+ num_crops = num_crops ,
86
+ image_tokens = self .image_tokens ,
87
+ image_token_id = self .image_token_id )
88
+ outputs .append (data )
89
+
90
+ messages .append (dict (role = 'preprocess' , content = outputs ))
82
91
return messages
83
92
84
93
@torch .no_grad ()
You can’t perform that action at this time.
0 commit comments