Skip to content

Commit

Permalink
Allow last line to be split into a separate batch
Browse files Browse the repository at this point in the history
  • Loading branch information
machinewrapped committed Nov 1, 2023
1 parent e02bac7 commit 27bc579
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PySubtitleGPT/SubtitleScene.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def SplitBatch(self, batch_number: int, line_number: int, translated_number: int

first_line = batch.originals[0]
last_line = batch.originals[-1]
if line_number <= first_line.number or line_number >= last_line.number:
if line_number <= first_line.number or line_number > last_line.number:
raise ValueError(f"Cannot split batch {batch_number} at line {line_number}")

split_index = next((i for i, line in enumerate(batch.originals) if line.number == line_number), -1)
Expand Down

0 comments on commit 27bc579

Please sign in to comment.