[VLM][Bugfix] internvl with num_scheduler_steps > 1 (#8614)
This commit is contained in:
parent
c6f2485c82
commit
0c4d2ad5e6
@ -19,7 +19,7 @@ from vllm.config import CacheConfig, MultiModalConfig
|
|||||||
from vllm.distributed import get_pp_group
|
from vllm.distributed import get_pp_group
|
||||||
from vllm.inputs import INPUT_REGISTRY, InputContext, LLMInputs
|
from vllm.inputs import INPUT_REGISTRY, InputContext, LLMInputs
|
||||||
from vllm.model_executor.layers.quantization import QuantizationConfig
|
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.model_loader.weight_utils import default_weight_loader
|
||||||
from vllm.model_executor.models.intern_vit import InternVisionModel
|
from vllm.model_executor.models.intern_vit import InternVisionModel
|
||||||
from vllm.model_executor.sampling_metadata import SamplingMetadata
|
from vllm.model_executor.sampling_metadata import SamplingMetadata
|
||||||
@ -379,6 +379,11 @@ class InternVLChatModel(nn.Module, SupportsMultiModal):
|
|||||||
self.make_empty_intermediate_tensors = (
|
self.make_empty_intermediate_tensors = (
|
||||||
self.language_model.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):
|
def pixel_shuffle(self, x, scale_factor=0.5):
|
||||||
n, w, h, c = x.size()
|
n, w, h, c = x.size()
|
||||||
# N, W, H, C --> N, W, H * scale, C // scale
|
# N, W, H, C --> N, W, H * scale, C // scale
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user