[Multimodal][Perf] Use pybase64 instead of base64 (#7724)

This commit is contained in:
Brayden Zhong
2025-07-08 17:00:58 -04:00
committed by GitHub
parent 136c6e0431
commit a37e1247c1
7 changed files with 20 additions and 18 deletions

View File

@@ -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):