Skip to content

Commit

Permalink
Fix error when force_tokens includes multi-word sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
cornzz committed Oct 16, 2024
1 parent 24f3da7 commit 56904e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def compress_prompt(prompt: str, rate: float, force_tokens: list[str], force_dig
diff = [
(word, (None, "+")[int(label)])
for line in result["fn_labeled_original_prompt"].split(word_sep)
for word, label in [line.split(label_sep)]
for word, label in [line.rsplit(label_sep, 1)]
]
return result["compressed_prompt"], diff, create_metrics_df(result), compression_time

Expand Down

0 comments on commit 56904e5

Please sign in to comment.