Update modeling_mplug_owl2.py
Browse files- modeling_mplug_owl2.py +1 -1
modeling_mplug_owl2.py
CHANGED
@@ -358,7 +358,7 @@ class MPLUGOwl2LlamaForCausalLM(LlamaForCausalLM, MPLUGOwl2MetaForCausalLM):
|
|
358 |
image_tensor = self.image_processor.preprocess(images, return_tensors='pt')['pixel_values'].half().to(self.device)
|
359 |
|
360 |
with torch.inference_mode():
|
361 |
-
output_logits = self
|
362 |
output_logits = output_logits.cpu().detach().numpy() / 100
|
363 |
print(output_logits)
|
364 |
probabilities.append(np.dot(softmax(output_logits), self.weight_tensor))
|
|
|
358 |
image_tensor = self.image_processor.preprocess(images, return_tensors='pt')['pixel_values'].half().to(self.device)
|
359 |
|
360 |
with torch.inference_mode():
|
361 |
+
output_logits = self(input_ids, images=image_tensor)["logits"][:, -1, self.preferential_ids_]
|
362 |
output_logits = output_logits.cpu().detach().numpy() / 100
|
363 |
print(output_logits)
|
364 |
probabilities.append(np.dot(softmax(output_logits), self.weight_tensor))
|