Skip to content

Commit

Permalink
Fix: BERTScoreMrefs computation when all sizes are equal.
Browse files Browse the repository at this point in the history
  • Loading branch information
Labbeti committed Jan 8, 2024
1 parent 42d0a16 commit 2628714
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
All notable changes to this project will be documented in this file.

## [0.5.3] UNRELEASED
### Added
### Fixed
- Fix `BERTScoreMrefs` computation when all sizes are equal.
- Check for empty timeout list in SPICE metric.

## [0.5.2] 2024-01-05
Expand Down
3 changes: 1 addition & 2 deletions src/aac_metrics/functional/bert_score_mrefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ def bert_score_mrefs(

if len(sizes) > 0 and all(size == sizes[0] for size in sizes):
sents_scores = {
k: reduction_fn(torch.as_tensor(v, dtype=dtype), dim=1)
for k, v in sents_scores.items()
k: reduction_fn(torch.stack(v), dim=1) for k, v in sents_scores.items()
}
else:
sents_scores = {
Expand Down
1 change: 0 additions & 1 deletion tests/test_all.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import platform
import unittest

from unittest import TestCase
Expand Down

0 comments on commit 2628714

Please sign in to comment.