🎉 Introduction to new functions of GPTCache
- Process the dialog context through the context processing interface, which currently supports two ways: summarize and selective context
import transformers
from gptcache.processor.context.summarization_context import SummarizationContextProcess
from gptcache.processor.context.selective_context import SelectiveContextProcess
from gptcache import cache
summarizer = transformers.pipeline("summarization", model="facebook/bart-large-cnn")
context_process = SummarizationContextProcess(summarizer, None, 512)
cache.init(
pre_embedding_func=context_process.pre_process,
)
context_processor = SelectiveContextProcess()
cache.init(
pre_embedding_func=context_process.pre_process,
)
What's Changed
- Add SummarizationContextProcess by @wxywb in #316
- Support duckdb by @SimFG in #323
- Add cmd for gptcache server by @Chiiizzzy in #325
- Support the selective context processor by @SimFG in #326
Full Changelog: 0.1.21...0.1.22