Upload modeling_mic21.py with huggingface_hub
Browse files- modeling_mic21.py +2 -2
modeling_mic21.py
CHANGED
|
@@ -64,8 +64,8 @@ class MIC21SummarizerModel(PreTrainedModel):
|
|
| 64 |
self.output_length = config.output_length
|
| 65 |
|
| 66 |
def forward(self, images, titles):
|
| 67 |
-
prepared_images = self.components["image_processor"](images,return_tensors="pt")
|
| 68 |
-
prepared_images = prepared_images
|
| 69 |
#prepared_images = prepared_images.to(f"cuda:{self.im_model_cuda_id}")
|
| 70 |
|
| 71 |
img_features = self.components["image_model"](**prepared_images,output_hidden_states=True)
|
|
|
|
| 64 |
self.output_length = config.output_length
|
| 65 |
|
| 66 |
def forward(self, images, titles):
|
| 67 |
+
prepared_images = self.components["image_processor"](images,return_tensors="pt", device="cuda")
|
| 68 |
+
prepared_images = prepared_images
|
| 69 |
#prepared_images = prepared_images.to(f"cuda:{self.im_model_cuda_id}")
|
| 70 |
|
| 71 |
img_features = self.components["image_model"](**prepared_images,output_hidden_states=True)
|