From d386ab141273041693455d33651a3cba6a12e8d1 Mon Sep 17 00:00:00 2001 From: maang Date: Tue, 6 Jan 2026 09:51:54 +0800 Subject: [PATCH] [Docs] Improve malformed exception caused by backslash line continuations (#31694) Signed-off-by: maang Signed-off-by: maang <55082429+maang-h@users.noreply.github.com> Co-authored-by: Cyrus Leung Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> --- vllm/config/compilation.py | 6 +++--- .../layers/fused_moe/rocm_aiter_fused_moe.py | 3 +-- vllm/model_executor/model_loader/weight_utils.py | 4 ++-- vllm/model_executor/models/llama.py | 4 ++-- vllm/model_executor/models/phi4mm.py | 7 +++---- vllm/multimodal/registry.py | 4 ++-- vllm/utils/argparse_utils.py | 3 +-- 7 files changed, 14 insertions(+), 17 deletions(-) diff --git a/vllm/config/compilation.py b/vllm/config/compilation.py index cd527e4198..7ac6ec0068 100644 --- a/vllm/config/compilation.py +++ b/vllm/config/compilation.py @@ -839,9 +839,9 @@ class CompilationConfig: """ if self.mode is None: raise ValueError( - "No compilation mode is set. This method should only be \ - called via vllm config where the level is set if none is \ - provided." + "No compilation mode is set. This method should only be " + "called via vllm config where the level is set if none is " + "provided." ) if self.mode == CompilationMode.NONE: raise ValueError("No compilation mode is set.") diff --git a/vllm/model_executor/layers/fused_moe/rocm_aiter_fused_moe.py b/vllm/model_executor/layers/fused_moe/rocm_aiter_fused_moe.py index ec1e410608..06707e5e48 100644 --- a/vllm/model_executor/layers/fused_moe/rocm_aiter_fused_moe.py +++ b/vllm/model_executor/layers/fused_moe/rocm_aiter_fused_moe.py @@ -231,8 +231,7 @@ def rocm_aiter_fused_experts( # w8a8 block-scaled if quant_config.block_shape is not None and quant_config.use_fp8_w8a8: assert not apply_router_weight_on_input, ( - "apply_router_weight_on_input is\ - not supported for block scaled moe" + "apply_router_weight_on_input is not supported for block scaled moe" ) assert quant_config.w1_scale is not None assert quant_config.w2_scale is not None diff --git a/vllm/model_executor/model_loader/weight_utils.py b/vllm/model_executor/model_loader/weight_utils.py index 0c5961561a..d55b61f27e 100644 --- a/vllm/model_executor/model_loader/weight_utils.py +++ b/vllm/model_executor/model_loader/weight_utils.py @@ -681,8 +681,8 @@ def safetensors_weights_iterator( # instead we reconstruct the subclasses here before returning if not torchao_version_at_least("0.15.0"): raise ValueError( - "Please use torchao version >= 0.15.0 \ - to load torchao safetensors checkpoint" + "Please use torchao version >= 0.15.0 " + "to load torchao safetensors checkpoint" ) from torchao.prototype.safetensors.safetensors_support import ( unflatten_tensor_state_dict, diff --git a/vllm/model_executor/models/llama.py b/vllm/model_executor/models/llama.py index f0f2983f84..4332acc821 100644 --- a/vllm/model_executor/models/llama.py +++ b/vllm/model_executor/models/llama.py @@ -201,8 +201,8 @@ class LlamaAttention(nn.Module): # This is a target model, use layer_idx directly effective_layer_idx = layer_idx assert effective_layer_idx < len(layer_types), ( - f"effective_layer_idx: {effective_layer_idx} \ - is out of bounds for layer_types: {layer_types}" + f"effective_layer_idx: {effective_layer_idx} " + f"is out of bounds for layer_types: {layer_types}" ) is_sliding = layer_types[effective_layer_idx] == "sliding_attention" diff --git a/vllm/model_executor/models/phi4mm.py b/vllm/model_executor/models/phi4mm.py index 179d5df869..c58abefc85 100644 --- a/vllm/model_executor/models/phi4mm.py +++ b/vllm/model_executor/models/phi4mm.py @@ -428,14 +428,13 @@ class Phi4MMImageEncoder(nn.Module): output_imgs.append(torch.cat([sub_img, self.glb_GN, glb_img], dim=1)) else: raise NotImplementedError( - f'hd_transform_order = {self.hd_transform_order}, "\ - "not implemented' + f"hd_transform_order = {self.hd_transform_order}, not implemented" ) # temp_len = int((h*w+1)*144 + 1 + (h+1)*12) assert temp_len == output_imgs[-1].shape[1], ( - f'temp_len: {temp_len}, output_imgs[-1].shape[1]: "\ - "{output_imgs[-1].shape[1]}' + f"temp_len: {temp_len}, output_imgs[-1].shape[1]: " + f"{output_imgs[-1].shape[1]}" ) output_len.append(temp_len) diff --git a/vllm/multimodal/registry.py b/vllm/multimodal/registry.py index b141125969..ed6a893288 100644 --- a/vllm/multimodal/registry.py +++ b/vllm/multimodal/registry.py @@ -367,8 +367,8 @@ class MultiModalRegistry: # than whisper. return 0 assert len(max_tokens) == 1, ( - "Encoder-decoder models are expected \ - to implement the multimodal interface with at most one modality." + "Encoder-decoder models are expected " + "to implement the multimodal interface with at most one modality." ) first_modality = next(iter(max_tokens)) diff --git a/vllm/utils/argparse_utils.py b/vllm/utils/argparse_utils.py index 87ee6f54c0..9c2cec876e 100644 --- a/vllm/utils/argparse_utils.py +++ b/vllm/utils/argparse_utils.py @@ -399,8 +399,7 @@ class FlexibleArgumentParser(ArgumentParser): index = args.index("--config") if index == len(args) - 1: raise ValueError( - "No config file specified! \ - Please check your command-line arguments." + "No config file specified! Please check your command-line arguments." ) file_path = args[index + 1]