Skip to content

Commit

Permalink
Revert "clip_score.py"
Browse files Browse the repository at this point in the history
This reverts commit 81b4405.
  • Loading branch information
rittik9 committed Jan 9, 2025
1 parent 81b4405 commit cd3663f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/torchmetrics/functional/multimodal/clip_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,12 @@ def _clip_score_update(
device = target_data[0].device
model = model.to(device)

source_features = _get_features(source_data, source_modality, device, model, processor)
target_features = _get_features(target_data, target_modality, device, model, processor)
source_features = _get_features(
cast(List[Union[Tensor, str]], source_data), source_modality, device, model, processor
)
target_features = _get_features(
cast(List[Union[Tensor, str]], target_data), target_modality, device, model, processor
)
source_features = source_features / source_features.norm(p=2, dim=-1, keepdim=True)
target_features = target_features / target_features.norm(p=2, dim=-1, keepdim=True)

Expand Down

0 comments on commit cd3663f

Please sign in to comment.