Skip to content

Commit

Permalink
remove type ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
ntlind committed Jun 26, 2024
1 parent 14dfc21 commit 1bc60a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/valor_api/backend/metrics/text_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def _calculate_sentence_bleu(
for pred, refs in zip(processed_predictions, processed_references):

tokenized_prediction = tokenizer.tokenize(pred)
tokenized_references = [tokenizer.tokenize(ref) for ref in refs] # type: ignore
tokenized_references = [tokenizer.tokenize(ref) for ref in refs]

# find the max value for each prediction
output[pred] = max(
Expand Down Expand Up @@ -401,7 +401,9 @@ def _compute_text_generation_metrics(
bleu_metrics = _calculate_sentence_bleu(
predictions=predictions,
references=references,
weights=metric_params.get("weights", [0.25, 0.25, 0.25, 0.25]), # type: ignore
weights=metric_params.get(
"weights", [0.25, 0.25, 0.25, 0.25]
),
)

output += [
Expand Down

0 comments on commit 1bc60a0

Please sign in to comment.