Unverified Commit a836524d authored by Isotr0py's avatar Isotr0py Committed by GitHub
Browse files

[Chore] Replace all base64 usages with faster pybase64 package (#37290)


Signed-off-by: default avatarIsotr0py <mozf@mail2.sysu.edu.cn>
parent 3717a4dd
...@@ -20,9 +20,9 @@ run the script with ...@@ -20,9 +20,9 @@ run the script with
python openai_chat_completion_client_for_multimodal.py --chat-type audio python openai_chat_completion_client_for_multimodal.py --chat-type audio
""" """
import base64
import os import os
import pybase64 as base64
import requests import requests
from openai import OpenAI from openai import OpenAI
from utils import get_first_model from utils import get_first_model
......
...@@ -24,11 +24,11 @@ The script: ...@@ -24,11 +24,11 @@ The script:
import argparse import argparse
import asyncio import asyncio
import base64
import json import json
import librosa import librosa
import numpy as np import numpy as np
import pybase64 as base64
import websockets import websockets
from vllm.assets.audio import AudioAsset from vllm.assets.audio import AudioAsset
......
...@@ -18,13 +18,13 @@ Requirements: websockets, numpy, gradio ...@@ -18,13 +18,13 @@ Requirements: websockets, numpy, gradio
import argparse import argparse
import asyncio import asyncio
import base64
import json import json
import queue import queue
import threading import threading
import gradio as gr import gradio as gr
import numpy as np import numpy as np
import pybase64 as base64
import websockets import websockets
SAMPLE_RATE = 16_000 SAMPLE_RATE = 16_000
......
...@@ -7,8 +7,8 @@ NOTE: ...@@ -7,8 +7,8 @@ NOTE:
""" """
import argparse import argparse
import base64
import pybase64 as base64
import requests import requests
import torch import torch
......
...@@ -7,10 +7,10 @@ Refer to each `run_*` function for the command to run the server for that model. ...@@ -7,10 +7,10 @@ Refer to each `run_*` function for the command to run the server for that model.
""" """
import argparse import argparse
import base64
import io import io
from typing import Literal from typing import Literal
import pybase64 as base64
from openai import OpenAI from openai import OpenAI
from openai._types import NOT_GIVEN, NotGiven from openai._types import NOT_GIVEN, NotGiven
from openai.types.chat import ChatCompletionMessageParam from openai.types.chat import ChatCompletionMessageParam
......
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import base64
import os import os
import pybase64 as base64
import torch import torch
from vllm import LLM from vllm import LLM
......
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import base64
import os import os
import pybase64 as base64
import requests import requests
# This example shows how to perform an online inference that generates # This example shows how to perform an online inference that generates
......
...@@ -15,9 +15,9 @@ Then run this script: ...@@ -15,9 +15,9 @@ Then run this script:
python colqwen3_rerank_online.py python colqwen3_rerank_online.py
""" """
import base64
from io import BytesIO from io import BytesIO
import pybase64 as base64
import requests import requests
from PIL import Image from PIL import Image
......
...@@ -21,10 +21,10 @@ Then run this script: ...@@ -21,10 +21,10 @@ Then run this script:
""" """
import argparse import argparse
import base64
from io import BytesIO from io import BytesIO
import numpy as np import numpy as np
import pybase64 as base64
import requests import requests
from PIL import Image from PIL import Image
......
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import base64
import os import os
from tempfile import NamedTemporaryFile from tempfile import NamedTemporaryFile
from typing import Any, cast from typing import Any, cast
import cv2 import cv2
import pybase64 as base64
import pytest import pytest
from transformers import AutoTokenizer, PreTrainedTokenizerBase from transformers import AutoTokenizer, PreTrainedTokenizerBase
......
...@@ -6,10 +6,10 @@ Unit tests for engine classes (parsing, validation, registry). ...@@ -6,10 +6,10 @@ Unit tests for engine classes (parsing, validation, registry).
Integration tests for NCCL and IPC weight transfer between processes using Ray. Integration tests for NCCL and IPC weight transfer between processes using Ray.
""" """
import base64
import pickle import pickle
from unittest.mock import MagicMock from unittest.mock import MagicMock
import pybase64 as base64
import pytest import pytest
import ray import ray
import torch import torch
......
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import base64
import json import json
import openai import openai
import pybase64 as base64
import pytest import pytest
import pytest_asyncio import pytest_asyncio
......
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import base64
import numpy as np import numpy as np
import pybase64 as base64
import pytest import pytest
import requests import requests
import torch import torch
......
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import base64
import io import io
import json import json
import openai # use the official client for correctness check import openai # use the official client for correctness check
import pybase64 as base64
import pytest import pytest
import pytest_asyncio import pytest_asyncio
import torch import torch
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import asyncio import asyncio
import base64
import json import json
import warnings import warnings
import librosa import librosa
import numpy as np import numpy as np
import pybase64 as base64
import pytest import pytest
import websockets import websockets
......
...@@ -7,10 +7,10 @@ embedding models, covering text embedding, embedding type conversions, ...@@ -7,10 +7,10 @@ embedding models, covering text embedding, embedding type conversions,
response structure, batching, normalisation, and semantic similarity. response structure, batching, normalisation, and semantic similarity.
""" """
import base64
import struct import struct
import numpy as np import numpy as np
import pybase64 as base64
import pytest import pytest
import requests import requests
......
...@@ -6,11 +6,11 @@ Validates image embedding, batching, normalisation, and embedding type ...@@ -6,11 +6,11 @@ Validates image embedding, batching, normalisation, and embedding type
conversions through the /v2/embed endpoint. conversions through the /v2/embed endpoint.
""" """
import base64
import struct import struct
import zlib import zlib
import numpy as np import numpy as np
import pybase64 as base64
import pytest import pytest
import requests import requests
......
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import base64
import json import json
import numpy as np import numpy as np
import openai import openai
import pybase64 as base64
import pytest import pytest
import pytest_asyncio import pytest_asyncio
import requests import requests
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
"""Unit tests for Cohere embed protocol: build_typed_embeddings and its """Unit tests for Cohere embed protocol: build_typed_embeddings and its
underlying packing helpers, plus Cohere-specific serving helpers.""" underlying packing helpers, plus Cohere-specific serving helpers."""
import base64
import struct import struct
import numpy as np import numpy as np
import pybase64 as base64
import pytest import pytest
from vllm.entrypoints.pooling.embed.protocol import ( from vllm.entrypoints.pooling.embed.protocol import (
......
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project # SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import base64
import json import json
import numpy as np import numpy as np
import pybase64 as base64
import pytest import pytest
import requests import requests
import torch import torch
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment