[Bugfix] Fix extra whitespace in strings caused by newline (#23272)
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
@@ -929,8 +929,8 @@ class HCXVisionForCausalLM(nn.Module, SupportsMultiModal, SupportsPP):
|
||||
target_group_size = 0
|
||||
|
||||
elif video_group_size < target_group_size:
|
||||
raise RuntimeError(f"video_group_size < target_group_size!! \
|
||||
[{video_group_size} < {target_group_size}]")
|
||||
raise RuntimeError(
|
||||
f"{video_group_size=} < {target_group_size=}")
|
||||
|
||||
assert len(target_features
|
||||
) == 0, f"target_features is not empty!! {target_features}"
|
||||
@@ -1114,9 +1114,8 @@ def reshape_and_unpad_image_features(
|
||||
base_image_feature = image_feature[0]
|
||||
image_feature = image_feature[1:]
|
||||
|
||||
assert (height * width == base_image_feature.shape[0]
|
||||
), f"height: {height}, width: {width}, \
|
||||
base_image_feature.shape[0]: {base_image_feature.shape[0]}"
|
||||
assert height * width == base_image_feature.shape[0], (
|
||||
f"{height=} * {width=} != {base_image_feature.shape[0]=}")
|
||||
|
||||
num_patch_width, num_patch_height = get_anyres_image_grid_shape(
|
||||
image_size, possible_resolutions, grid_size)
|
||||
|
||||
@@ -262,9 +262,9 @@ class Phi4MMImageEncoder(nn.Module):
|
||||
img_features.shape[1]))
|
||||
assert base_feat_height == base_feat_height_target \
|
||||
and base_feat_width == base_feat_height_target, \
|
||||
f'base_feat_height: {base_feat_height},"\
|
||||
f" base_feat_width: {base_feat_width}, "\
|
||||
f"expect {base_feat_height_target} features for hd transform'
|
||||
(f"base_feat_height: {base_feat_height}, "
|
||||
f"base_feat_width: {base_feat_width}, "
|
||||
f"expect {base_feat_height_target} features for hd transform")
|
||||
|
||||
# bs x max_num_crops x (24x24) x C
|
||||
img_features = img_features.view(bs, -1,
|
||||
|
||||
Reference in New Issue
Block a user