diff --git a/llmlingua/prompt_compressor.py b/llmlingua/prompt_compressor.py index 33dcbd4..0e7bcb6 100644 --- a/llmlingua/prompt_compressor.py +++ b/llmlingua/prompt_compressor.py @@ -840,12 +840,14 @@ def sync_sentence(sentences, text): sentence_num = len(sentences) new_sentences = [] for i, s in enumerate(sentences): - assert s == text[seen_text: seen_text + len(s)] + assert s == text[seen_text : seen_text + len(s)] if i == sentence_num - 1: new_sentences.append(text[seen_text:]) break - next_sentence_start = text.find(sentences[i + 1][:5], seen_text + len(s)) - new_sentences.append(text[seen_text: next_sentence_start]) + next_sentence_start = text.find( + sentences[i + 1][:5], seen_text + len(s) + ) + new_sentences.append(text[seen_text:next_sentence_start]) seen_text = next_sentence_start assert "".join(new_sentences) == text return new_sentences diff --git a/llmlingua/version.py b/llmlingua/version.py index 4d117f2..cb0f052 100644 --- a/llmlingua/version.py +++ b/llmlingua/version.py @@ -2,10 +2,10 @@ # Licensed under The MIT License [see LICENSE for details] _MAJOR = "0" -_MINOR = "1" +_MINOR = "2" # On master and in a nightly release the patch should be one ahead of the last # released build. -_PATCH = "6" +_PATCH = "0" # This is mainly for nightly builds which have the suffix ".dev$DATE". See # https://semver.org/#is-v123-a-semantic-version for the semantics. _SUFFIX = ""