[Multimodal][Perf] Use pybase64 instead of base64 (#7724)
This commit is contained in:
@@ -28,12 +28,12 @@ LLaVA-Onevision : https://arxiv.org/pdf/2408.03326
|
||||
|
||||
"""
|
||||
import ast
|
||||
import base64
|
||||
import math
|
||||
import re
|
||||
from io import BytesIO
|
||||
|
||||
import numpy as np
|
||||
import pybase64
|
||||
from PIL import Image
|
||||
|
||||
from sglang.srt.utils import flatten_nested_list
|
||||
@@ -252,7 +252,7 @@ def process_anyres_image(image, processor, grid_pinpoints):
|
||||
|
||||
|
||||
def load_image_from_base64(image):
|
||||
return Image.open(BytesIO(base64.b64decode(image)))
|
||||
return Image.open(BytesIO(pybase64.b64decode(image, validate=True)))
|
||||
|
||||
|
||||
def expand2square(pil_img, background_color):
|
||||
|
||||
Reference in New Issue
Block a user