Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenshansilvia committed Sep 26, 2024
1 parent eac3ec1 commit 1b78aa1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rageval/metrics/answer_informativeness/_text_length.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, tokenize_model: str = "Qwen/Qwen2-0.5B-Instruct"):

def __repr__(self) -> str:
""":return: Formatted string representation of the metric."""
return f"{self.ALIAS[0]}" # pragma: no cover
return f"{self.ALIAS[0]}" # pragma: no cover

def _info(self):
return datasets.MetricInfo(
Expand Down
10 changes: 5 additions & 5 deletions rageval/metrics/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ def _compute_batch(
) -> List[float]:
"""Compute the metric for a batch of predictions and references."""
scores = []
if (pred_answers and ref_answers): # if both columns exist
if (pred_answers and ref_answers): # if both columns exist
for pred_answer, ref_answer in tqdm(zip(pred_answers, ref_answers),
desc=f"Computing {self.name}",
total=len(pred_answers)):
desc=f"Computing {self.name}",
total=len(pred_answers)):
scores.append(self._compute_one(pred_answer, ref_answer))
else:
for pred_answer in tqdm(pred_answers,
desc=f"Computing {self.name}",
total=len(pred_answers)):
desc=f"Computing {self.name}",
total=len(pred_answers)):
scores.append(self._compute_one(pred_answer))
return scores

Expand Down

0 comments on commit 1b78aa1

Please sign in to comment.