Skip to content

Commit

Permalink
Fix(LLMLingua): fix the assert issue due to tokenization (#139)
Browse files Browse the repository at this point in the history
* fix tokenizer bug
* exclude macros-latest on python3.9 unit test for environment conflict
  • Loading branch information
SiyunZhao authored Apr 25, 2024
1 parent a411a3f commit 40ac969
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
python-version: ["3.9", "3.10", "3.11"]
exclude:
- os: macos-latest
python-version: '3.9'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
1 change: 0 additions & 1 deletion llmlingua/prompt_compressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,6 @@ def get_prefix_length(self, prefix: str, text: str):
cur_prefix = self.tokenizer.decode(full_input_ids[:i])
if cur_prefix == prefix:
break
assert self.tokenizer.decode(full_input_ids[i:]) == text[:100]
return i

def get_condition_ppl(
Expand Down

0 comments on commit 40ac969

Please sign in to comment.