Skip to content

Commit

Permalink
fix zero division error
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikvirendrar committed Nov 4, 2024
1 parent d0565d9 commit fb9b84b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions backend/voiceover/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,10 @@ def get_payload(request):
+ float(time_difference.split(":")[1]) * 60
+ float(time_difference.split(":")[2])
)
text_length_per_second = len(transcription_text)/t_d
try:
text_length_per_second = len(transcription_text)/t_d
except ZeroDivisionError:
text_length_per_second = 0
sentences_list.append(
{
"id": str(int(audio_index) + 1),
Expand Down Expand Up @@ -1494,7 +1497,10 @@ def save_voice_over(request):
}
)
else:
text_length_per_second = len(transcription_text)/t_d
try:
text_length_per_second = len(transcription_text)/t_d
except ZeroDivisionError:
text_length_per_second = 0
voice_over_obj.payload["payload"][
str(start_offset + i)
] = {
Expand Down

0 comments on commit fb9b84b

Please sign in to comment.