Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
Fix division by 0
Browse files Browse the repository at this point in the history
Summary: As in title

Differential Revision: D8608223

fbshipit-source-id: 0286e7ae6204f3e96df176f693f8aa535eb9d7ff
  • Loading branch information
ola13 authored and facebook-github-bot committed Jun 25, 2018
1 parent 4062c21 commit 25d0bb0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/doc/examples/compute_accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,9 @@ def print_compute_accuracy_score(

print(
"Questions seen / total: {0} {1} {2:.2f} %".
format(total_qs, total_num_lines, total_qs / total_num_lines * 100)
format(
total_qs,
total_num_lines,
total_qs / total_num_lines * 100 if total_num_lines > 0 else 0,
)
)

0 comments on commit 25d0bb0

Please sign in to comment.