Skip to content

Commit

Permalink
range isn't inclusive, add 1 to max_overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
Y4hL committed Mar 14, 2024
1 parent 0e50465 commit 46ff098
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llms/mlx_lm/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def sequence_overlap(s1: Sequence, s2: Sequence) -> bool:
bool: If the two sequences have overlap
"""
max_overlap = min(len(s1), len(s2))
return any(s1[-i:] == s2[:i] for i in range(1, max_overlap))
return any(s1[-i:] == s2[:i] for i in range(1, max_overlap + 1))


def convert_chat(messages: List[dict], role_mapping: Optional[dict] = None):
Expand Down

0 comments on commit 46ff098

Please sign in to comment.