Skip to content

Commit

Permalink
formating
Browse files Browse the repository at this point in the history
  • Loading branch information
adobrzyniewicz-habana committed Dec 17, 2024
1 parent adac58e commit e8ce81e
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions vllm/worker/hpu_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
from vllm.model_executor.models import supports_multimodal
from vllm.model_executor.sampling_metadata import SequenceGroupToSample
from vllm.multimodal import (MULTIMODAL_REGISTRY, BatchedTensorInputs,
MultiModalKwargs, MultiModalRegistry, MultiModalPlaceholderMap)
MultiModalKwargs, MultiModalPlaceholderMap,
MultiModalRegistry)
from vllm.sampling_params import SamplingParams
from vllm.sequence import (CompletionSequenceGroupOutput, IntermediateTensors,
Logprob, SequenceData, SequenceGroupMetadata,
Expand Down Expand Up @@ -794,9 +795,9 @@ def _prepare_prompt(
prefix_block_tables: List[List[int]] = []
multi_modal_kwargs_list: List[MultiModalKwargs] = []
multi_modal_placeholder_maps: Dict[
str,
MultiModalPlaceholderMap] = collections.defaultdict(MultiModalPlaceholderMap)
str, MultiModalPlaceholderMap] = collections.defaultdict(
MultiModalPlaceholderMap)

if len(seq_group_metadata_list) == 0:
return PreparePromptMetadata.empty()

Expand Down Expand Up @@ -853,8 +854,8 @@ def _prepare_prompt(
# is always the first token in the sequence.
input_positions.append(list(range(context_len, seq_len)))

mm_data = seq_group_metadata.multi_modal_data
if mm_data:
mm_data = seq_group_metadata.multi_modal_data
if mm_data:
mm_kwargs = self.multi_modal_input_mapper(mm_data)
multi_modal_kwargs_list.append(mm_kwargs)

Expand All @@ -865,10 +866,7 @@ def _prepare_prompt(
mm_data, placeholder_maps = MultiModalPlaceholderMap \
.from_seq_group(seq_group_metadata, positions_range)

print(mm_data)

if self.mm_registry.has_processor(
self.model_config):
if self.mm_registry.has_processor(self.model_config):
mm_kwargs = mm_data
else:
mm_kwargs = self.multi_modal_input_mapper(
Expand Down

0 comments on commit e8ce81e

Please sign in to comment.