Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
python openai_chat_completion_client_for_multimodal.py --chat-type audio
"""

import base64
import os

import pybase64 as base64
import requests
from openai import OpenAI
from utils import get_first_model
Expand Down
2 changes: 1 addition & 1 deletion examples/online_serving/openai_realtime_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@

import argparse
import asyncio
import base64
import json

import librosa
import numpy as np
import pybase64 as base64
import websockets

from vllm.assets.audio import AudioAsset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@

import argparse
import asyncio
import base64
import json
import queue
import threading

import gradio as gr
import numpy as np
import pybase64 as base64
import websockets

SAMPLE_RATE = 16_000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"""

import argparse
import base64

import pybase64 as base64
import requests
import torch

Expand Down
2 changes: 1 addition & 1 deletion examples/pooling/embed/vision_embedding_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"""

import argparse
import base64
import io
from typing import Literal

import pybase64 as base64
from openai import OpenAI
from openai._types import NOT_GIVEN, NotGiven
from openai.types.chat import ChatCompletionMessageParam
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import base64
import os

import pybase64 as base64
import torch

from vllm import LLM
Expand Down
2 changes: 1 addition & 1 deletion examples/pooling/plugin/prithvi_geospatial_mae_online.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

import base64
import os

import pybase64 as base64
import requests

# This example shows how to perform an online inference that generates
Expand Down
2 changes: 1 addition & 1 deletion examples/pooling/score/colqwen3_rerank_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
python colqwen3_rerank_online.py
"""

import base64
from io import BytesIO

import pybase64 as base64
import requests
from PIL import Image

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
"""

import argparse
import base64
from io import BytesIO

import numpy as np
import pybase64 as base64
import requests
from PIL import Image

Expand Down
2 changes: 1 addition & 1 deletion tests/benchmarks/test_random_multimodal_dataset_video.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

import base64
import os
from tempfile import NamedTemporaryFile
from typing import Any, cast

import cv2
import pybase64 as base64
import pytest
from transformers import AutoTokenizer, PreTrainedTokenizerBase

Expand Down
2 changes: 1 addition & 1 deletion tests/distributed/test_weight_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
Integration tests for NCCL and IPC weight transfer between processes using Ray.
"""

import base64
import pickle
from unittest.mock import MagicMock

import pybase64 as base64
import pytest
import ray
import torch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

import base64
import json

import openai
import pybase64 as base64
import pytest
import pytest_asyncio

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

import base64

import numpy as np
import pybase64 as base64
import pytest
import requests
import torch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

import base64
import io
import json

import openai # use the official client for correctness check
import pybase64 as base64
import pytest
import pytest_asyncio
import torch
Expand Down
2 changes: 1 addition & 1 deletion tests/entrypoints/openai/test_realtime_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

import asyncio
import base64
import json
import warnings

import librosa
import numpy as np
import pybase64 as base64
import pytest
import websockets

Expand Down
2 changes: 1 addition & 1 deletion tests/entrypoints/pooling/embed/test_cohere_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
response structure, batching, normalisation, and semantic similarity.
"""

import base64
import struct

import numpy as np
import pybase64 as base64
import pytest
import requests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
conversions through the /v2/embed endpoint.
"""

import base64
import struct
import zlib

import numpy as np
import pybase64 as base64
import pytest
import requests

Expand Down
2 changes: 1 addition & 1 deletion tests/entrypoints/pooling/embed/test_online.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

import base64
import json

import numpy as np
import openai
import pybase64 as base64
import pytest
import pytest_asyncio
import requests
Expand Down
2 changes: 1 addition & 1 deletion tests/entrypoints/pooling/embed/test_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"""Unit tests for Cohere embed protocol: build_typed_embeddings and its
underlying packing helpers, plus Cohere-specific serving helpers."""

import base64
import struct

import numpy as np
import pybase64 as base64
import pytest

from vllm.entrypoints.pooling.embed.protocol import (
Expand Down
2 changes: 1 addition & 1 deletion tests/entrypoints/pooling/pooling/test_online.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

import base64
import json

import numpy as np
import pybase64 as base64
import pytest
import requests
import torch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1235,9 +1235,9 @@ def voxtral_patch_hf_runner(hf_model: "HfRunner") -> "HfRunner":
generated).
"""

import base64
import io

import pybase64 as base64
import soundfile as sf

processor = hf_model.processor
Expand Down
2 changes: 1 addition & 1 deletion tests/models/multimodal/pooling/test_colpali.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
It produces per-token embeddings for both text and image inputs.
"""

import base64
from io import BytesIO

import pybase64 as base64
import pytest
import torch
from PIL import Image
Expand Down
2 changes: 1 addition & 1 deletion tests/models/multimodal/pooling/test_colqwen3.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
embeddings for both text and image inputs.
"""

import base64
from io import BytesIO

import pybase64 as base64
import pytest
import torch
from PIL import Image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
Both variants share a SigLIP vision encoder with a bidirectional LLaMA backbone.
"""

import base64
from io import BytesIO
from pathlib import Path

import pybase64 as base64
import pytest
import torch
from transformers import AutoModel, AutoModelForSequenceClassification, AutoProcessor
Expand Down
2 changes: 1 addition & 1 deletion tests/multimodal/media/test_audio.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import base64
from pathlib import Path
from unittest.mock import patch

import librosa
import numpy as np
import pybase64 as base64
import pytest

from vllm.multimodal.media import AudioMediaIO
Expand Down
2 changes: 1 addition & 1 deletion tests/multimodal/media/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

import asyncio
import base64
import mimetypes
import os
from tempfile import NamedTemporaryFile, TemporaryDirectory

import aiohttp
import numpy as np
import pybase64 as base64
import pytest
import requests
import torch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project

import base64
import datetime
import os
import tempfile
Expand All @@ -11,6 +10,7 @@

import albumentations
import numpy as np
import pybase64 as base64
import rasterio
import regex as re
import torch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import base64
import io

import imagehash
import pybase64 as base64
import pytest
import requests
from PIL import Image
Expand Down
2 changes: 1 addition & 1 deletion tests/renderers/test_sparse_tensor_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
out-of-bounds memory writes during to_dense() operations.
"""

import base64
import io

import pybase64 as base64
import pytest
import torch

Expand Down
8 changes: 8 additions & 0 deletions tools/pre_commit/check_forbidden_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ class ForbiddenImport:
"vllm/v1/serial_utils.py",
},
),
"base64": ForbiddenImport(
pattern=r"^\s*(?:import\s+base64(?:$|\s|,)|from\s+base64\s+import)",
tip=(
"Replace 'import base64' with 'import pybase64' "
"or 'import pybase64 as base64'."
),
allowed_pattern=re.compile(r"^\s*import\s+pybase64(\s*|\s+as\s+base64\s*)$"),
),
"re": ForbiddenImport(
pattern=r"^\s*(?:import\s+re(?:$|\s|,)|from\s+re\s+import)",
tip="Replace 'import re' with 'import regex as re' or 'import regex'.",
Expand Down
2 changes: 1 addition & 1 deletion vllm/benchmarks/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import argparse
import ast
import base64
import io
import json
import logging
Expand All @@ -31,6 +30,7 @@
from typing import Any, cast

import numpy as np
import pybase64 as base64
from huggingface_hub import snapshot_download
from PIL import Image
from typing_extensions import deprecated
Expand Down
2 changes: 1 addition & 1 deletion vllm/distributed/weight_transfer/ipc_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
"""IPC-based weight transfer engine using CUDA IPC for communication."""

import base64
import pickle
from collections.abc import Callable, Iterator
from dataclasses import asdict, dataclass
from typing import Any

import pybase64 as base64
import requests
import torch
from torch.multiprocessing.reductions import reduce_tensor
Expand Down
Loading
Loading