Skip to content

Commit

Permalink
🐛 Fix minor bug in create_input for regen
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Martinez <[email protected]>
  • Loading branch information
marmg committed Feb 21, 2024
1 parent 7d4abf4 commit b9a71c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions zshot/linker/linker_regen/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def create_input(sentence, max_length, start_delimiter, end_delimiter):
left_index = max(0, start_delimiter_index - half_context)
right_index = min(len(sent_list),
end_delimiter_index + half_context + (half_context - (start_delimiter_index - left_index)))
if right_index == end_delimiter_index:
right_index += 1

Check warning on line 25 in zshot/linker/linker_regen/utils.py

View check run for this annotation

Codecov / codecov/patch

zshot/linker/linker_regen/utils.py#L25

Added line #L25 was not covered by tests

left_index = left_index - max(0, (half_context - (right_index - end_delimiter_index)))
return " ".join(sent_list[left_index:right_index])

Expand Down

0 comments on commit b9a71c6

Please sign in to comment.