Inclusion of InternVLChatModel In PP_SUPPORTED_MODELS(Pipeline Parallelism) (#7860)

This commit is contained in:
manikandan.tm@zucisystems.com
2024-09-05 11:33:37 +00:00
committed by GitHub
parent 288a938872
commit 8685ba1a1e
6 changed files with 90 additions and 35 deletions
+3 -1
View File
@@ -341,6 +341,8 @@ class InternVLChatModel(nn.Module, SupportsMultiModal):
nn.Linear(llm_hidden_size, llm_hidden_size))
self.img_context_token_id = None
self.make_empty_intermediate_tensors = (
self.language_model.make_empty_intermediate_tensors)
def pixel_shuffle(self, x, scale_factor=0.5):
n, w, h, c = x.size()
@@ -461,7 +463,7 @@ class InternVLChatModel(nn.Module, SupportsMultiModal):
positions,
kv_caches,
attn_metadata,
None,
intermediate_tensors,
inputs_embeds=inputs_embeds)
return hidden_states