The pre-trained model to use for compression.
The pre-trained tokenizer to use for compression.
Function to get the pure token from a token. This is used to normalize tokens before processing.
Function to check if a token is the beginning of a new word. This is used to determine how to merge tokens into words.
The tokenizer to use calculating the compression rate. It needs to return a collection that exposes length.
Configuration for LLMLingua2.
Logger function to log messages.
Compresses a prompt based on the given options.
The TypeScript implementation on original
PromptCompressor, which is a class for compressing prompts using a language model.See
Original Implementation