Skip to content

Commit

Permalink
check if found or not
Browse files Browse the repository at this point in the history
  • Loading branch information
donghyeonk committed Apr 24, 2023
1 parent 8500cfd commit 3ff0332
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ def get_mrr_ndcg(calc_ndcg=False):
for target_slot_idx, ota in zip(targets, outputs_topall_idxes):
target_rank_idx = -1
for rank_idx, slot_idx in enumerate(ota):
if target_slot_idx.item() == slot_idx.item():
if -1 == target_rank_idx and target_slot_idx.item() == slot_idx.item():
target_rank_idx = rank_idx
if not calc_ndcg:
break
Expand Down

0 comments on commit 3ff0332

Please sign in to comment.