Skip to content

Commit

Permalink
[VLM][Bugfix] internvl with num_scheduler_steps > 1 (vllm-project#8614)
Browse files Browse the repository at this point in the history
  • Loading branch information
DefTruth authored and liuyanyi committed Oct 6, 2024
1 parent bd15e5b commit 6c9237d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vllm/model_executor/models/internvl.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from vllm.distributed import get_pp_group
from vllm.inputs import INPUT_REGISTRY, InputContext, LLMInputs
from vllm.model_executor.layers.quantization import QuantizationConfig
from vllm.model_executor.layers.sampler import SamplerOutput
from vllm.model_executor.layers.sampler import Sampler, SamplerOutput
from vllm.model_executor.model_loader.weight_utils import default_weight_loader
from vllm.model_executor.models.intern_vit import InternVisionModel
from vllm.model_executor.sampling_metadata import SamplingMetadata
Expand Down Expand Up @@ -379,6 +379,11 @@ def __init__(self,
self.make_empty_intermediate_tensors = (
self.language_model.make_empty_intermediate_tensors)

if hasattr(self.language_model, "sampler"):
self.sampler = self.language_model.sampler
else:
self.sampler = Sampler()

def pixel_shuffle(self, x, scale_factor=0.5):
n, w, h, c = x.size()
# N, W, H, C --> N, W, H * scale, C // scale
Expand Down

0 comments on commit 6c9237d

Please sign in to comment.