File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
internvl_chat/internvl/model/internvl_chat Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ def forward(
122122 return_dict = return_dict if return_dict is not None else self .config .use_return_dict
123123
124124 image_flags = image_flags .squeeze (- 1 )
125- input_embeds = self .language_model .get_input_embeddings ()(input_ids )
125+ input_embeds = self .language_model .get_input_embeddings ()(input_ids ). clone ()
126126
127127 vit_embeds = self .extract_feature (pixel_values )
128128 vit_embeds = vit_embeds [image_flags == 1 ]
@@ -131,8 +131,8 @@ def forward(
131131 B , N , C = input_embeds .shape
132132 input_embeds = input_embeds .reshape (B * N , C )
133133
134- if torch .distributed .get_rank () == 0 :
135- print (f'dynamic ViT batch size: { vit_batch_size } , images per sample: { vit_batch_size / B } , dynamic token length: { N } ' )
134+ # if torch.distributed.get_rank() == 0:
135+ # print(f'dynamic ViT batch size: {vit_batch_size}, images per sample: {vit_batch_size / B}, dynamic token length: {N}')
136136
137137 input_ids = input_ids .reshape (B * N )
138138 selected = (input_ids == self .img_context_token_id )
You can’t perform that action at this time.
0 commit comments