github zilliztech/GPTCache 0.1.22
v0.1.22

latest releases: 0.1.44, 0.1.43, 0.1.42...
16 months ago

🎉 Introduction to new functions of GPTCache

  1. 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

Full Changelog: 0.1.21...0.1.22

Don't miss a new GPTCache release

NewReleases is sending notifications on new releases.