Skip to content

Commit 0c4d2ad

Browse files
authored
[VLM][Bugfix] internvl with num_scheduler_steps > 1 (#8614)
1 parent c6f2485 commit 0c4d2ad

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

vllm/model_executor/models/internvl.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from vllm.distributed import get_pp_group
2020
from vllm.inputs import INPUT_REGISTRY, InputContext, LLMInputs
2121
from vllm.model_executor.layers.quantization import QuantizationConfig
22-
from vllm.model_executor.layers.sampler import SamplerOutput
22+
from vllm.model_executor.layers.sampler import Sampler, SamplerOutput
2323
from vllm.model_executor.model_loader.weight_utils import default_weight_loader
2424
from vllm.model_executor.models.intern_vit import InternVisionModel
2525
from vllm.model_executor.sampling_metadata import SamplingMetadata
@@ -379,6 +379,11 @@ def __init__(self,
379379
self.make_empty_intermediate_tensors = (
380380
self.language_model.make_empty_intermediate_tensors)
381381

382+
if hasattr(self.language_model, "sampler"):
383+
self.sampler = self.language_model.sampler
384+
else:
385+
self.sampler = Sampler()
386+
382387
def pixel_shuffle(self, x, scale_factor=0.5):
383388
n, w, h, c = x.size()
384389
# N, W, H, C --> N, W, H * scale, C // scale

0 commit comments

Comments
 (0)