Unverified Commit d386ab14 authored by maang's avatar maang Committed by GitHub
Browse files

[Docs] Improve malformed exception caused by backslash line continuations (#31694)


Signed-off-by: default avatarmaang <maang_h@163.com>
Signed-off-by: default avatarmaang <55082429+maang-h@users.noreply.github.com>
Co-authored-by: default avatarCyrus Leung <cyrus.tl.leung@gmail.com>
Co-authored-by: default avatarWentao Ye <44945378+yewentao256@users.noreply.github.com>
parent ccb309a9
...@@ -839,9 +839,9 @@ class CompilationConfig: ...@@ -839,9 +839,9 @@ class CompilationConfig:
""" """
if self.mode is None: if self.mode is None:
raise ValueError( raise ValueError(
"No compilation mode is set. This method should only be \ "No compilation mode is set. This method should only be "
called via vllm config where the level is set if none is \ "called via vllm config where the level is set if none is "
provided." "provided."
) )
if self.mode == CompilationMode.NONE: if self.mode == CompilationMode.NONE:
raise ValueError("No compilation mode is set.") raise ValueError("No compilation mode is set.")
......
...@@ -231,8 +231,7 @@ def rocm_aiter_fused_experts( ...@@ -231,8 +231,7 @@ def rocm_aiter_fused_experts(
# w8a8 block-scaled # w8a8 block-scaled
if quant_config.block_shape is not None and quant_config.use_fp8_w8a8: if quant_config.block_shape is not None and quant_config.use_fp8_w8a8:
assert not apply_router_weight_on_input, ( assert not apply_router_weight_on_input, (
"apply_router_weight_on_input is\ "apply_router_weight_on_input is not supported for block scaled moe"
not supported for block scaled moe"
) )
assert quant_config.w1_scale is not None assert quant_config.w1_scale is not None
assert quant_config.w2_scale is not None assert quant_config.w2_scale is not None
......
...@@ -681,8 +681,8 @@ def safetensors_weights_iterator( ...@@ -681,8 +681,8 @@ def safetensors_weights_iterator(
# instead we reconstruct the subclasses here before returning # instead we reconstruct the subclasses here before returning
if not torchao_version_at_least("0.15.0"): if not torchao_version_at_least("0.15.0"):
raise ValueError( raise ValueError(
"Please use torchao version >= 0.15.0 \ "Please use torchao version >= 0.15.0 "
to load torchao safetensors checkpoint" "to load torchao safetensors checkpoint"
) )
from torchao.prototype.safetensors.safetensors_support import ( from torchao.prototype.safetensors.safetensors_support import (
unflatten_tensor_state_dict, unflatten_tensor_state_dict,
......
...@@ -201,8 +201,8 @@ class LlamaAttention(nn.Module): ...@@ -201,8 +201,8 @@ class LlamaAttention(nn.Module):
# This is a target model, use layer_idx directly # This is a target model, use layer_idx directly
effective_layer_idx = layer_idx effective_layer_idx = layer_idx
assert effective_layer_idx < len(layer_types), ( assert effective_layer_idx < len(layer_types), (
f"effective_layer_idx: {effective_layer_idx} \ f"effective_layer_idx: {effective_layer_idx} "
is out of bounds for layer_types: {layer_types}" f"is out of bounds for layer_types: {layer_types}"
) )
is_sliding = layer_types[effective_layer_idx] == "sliding_attention" is_sliding = layer_types[effective_layer_idx] == "sliding_attention"
......
...@@ -428,14 +428,13 @@ class Phi4MMImageEncoder(nn.Module): ...@@ -428,14 +428,13 @@ class Phi4MMImageEncoder(nn.Module):
output_imgs.append(torch.cat([sub_img, self.glb_GN, glb_img], dim=1)) output_imgs.append(torch.cat([sub_img, self.glb_GN, glb_img], dim=1))
else: else:
raise NotImplementedError( raise NotImplementedError(
f'hd_transform_order = {self.hd_transform_order}, "\ f"hd_transform_order = {self.hd_transform_order}, not implemented"
"not implemented'
) )
# temp_len = int((h*w+1)*144 + 1 + (h+1)*12) # temp_len = int((h*w+1)*144 + 1 + (h+1)*12)
assert temp_len == output_imgs[-1].shape[1], ( assert temp_len == output_imgs[-1].shape[1], (
f'temp_len: {temp_len}, output_imgs[-1].shape[1]: "\ f"temp_len: {temp_len}, output_imgs[-1].shape[1]: "
"{output_imgs[-1].shape[1]}' f"{output_imgs[-1].shape[1]}"
) )
output_len.append(temp_len) output_len.append(temp_len)
......
...@@ -367,8 +367,8 @@ class MultiModalRegistry: ...@@ -367,8 +367,8 @@ class MultiModalRegistry:
# than whisper. # than whisper.
return 0 return 0
assert len(max_tokens) == 1, ( assert len(max_tokens) == 1, (
"Encoder-decoder models are expected \ "Encoder-decoder models are expected "
to implement the multimodal interface with at most one modality." "to implement the multimodal interface with at most one modality."
) )
first_modality = next(iter(max_tokens)) first_modality = next(iter(max_tokens))
......
...@@ -399,8 +399,7 @@ class FlexibleArgumentParser(ArgumentParser): ...@@ -399,8 +399,7 @@ class FlexibleArgumentParser(ArgumentParser):
index = args.index("--config") index = args.index("--config")
if index == len(args) - 1: if index == len(args) - 1:
raise ValueError( raise ValueError(
"No config file specified! \ "No config file specified! Please check your command-line arguments."
Please check your command-line arguments."
) )
file_path = args[index + 1] file_path = args[index + 1]
......
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