Unverified Commit e97e57e6 authored by XinyuanTong's avatar XinyuanTong Committed by GitHub
Browse files

Remove unused method `calculate_num_image_tokens` from qwen2_vl.py (#5783)

parent 9a6ad891
...@@ -442,18 +442,6 @@ class Qwen2VLForConditionalGeneration(nn.Module): ...@@ -442,18 +442,6 @@ class Qwen2VLForConditionalGeneration(nn.Module):
"up_proj": ("gate_up_proj", 1), "up_proj": ("gate_up_proj", 1),
} }
def calculate_num_image_tokens(self, image_grid_thw: Tuple[int, int, int]):
processor = cached_get_processor(self.config._name_or_path)
grid_t, grid_h, grid_w = image_grid_thw
num_image_tokens = (
grid_t
* grid_h
* grid_w
// processor.image_processor.merge_size
// processor.image_processor.merge_size
)
return num_image_tokens
def __init__( def __init__(
self, self,
config: Qwen2VLConfig, config: Qwen2VLConfig,
......
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