File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 1313TODO: Implement CustomDataset to parse a JSON file and convert its contents into
1414SampleRequest instances, similar to the approach used in ShareGPT.
1515"""
16-
1716import base64
1817import io
1918import json
3332from vllm .lora .request import LoRARequest
3433from vllm .lora .utils import get_adapter_absolute_path
3534from vllm .multimodal import MultiModalDataDict
35+ from vllm .multimodal .image import convert_image_mode
3636from vllm .transformers_utils .tokenizer import AnyTokenizer , get_lora_tokenizer
3737
3838logger = logging .getLogger (__name__ )
@@ -259,7 +259,7 @@ def process_image(image: Any) -> Mapping[str, Any]:
259259 if isinstance (image , dict ) and 'bytes' in image :
260260 image = Image .open (BytesIO (image ['bytes' ]))
261261 if isinstance (image , Image .Image ):
262- image = image . convert ( "RGB" )
262+ image = convert_image_mode ( image , "RGB" )
263263 with io .BytesIO () as image_data :
264264 image .save (image_data , format = "JPEG" )
265265 image_base64 = base64 .b64encode (
You can’t perform that action at this time.
0 commit comments