github zilliztech/GPTCache 0.1.16
v0.1.16

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

🎉 Introduction to new functions of GPTCache

  1. Add StableDiffusion adapter (experimental)
import torch

from gptcache.adapter.diffusers import StableDiffusionPipeline
from gptcache.processor.pre import get_prompt
from gptcache import cache

cache.init(
    pre_embedding_func=get_prompt,
)
model_id = "stabilityai/stable-diffusion-2-1"
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16)

prompt = "a photo of an astronaut riding a horse on mars"
pipe(prompt=prompt).images[0]
  1. Add speech to text bootcamp, link

  2. More convenient management of cache files

from gptcache.manager.factory import manager_factory

data_manager = manager_factory('sqlite,faiss', data_dir="test_cache", vector_params={"dimension": 5})
  1. Add a simple GPTCache server (experimental)

After starting this server, you can:

  • put the data to cache, like: curl -X PUT -d "receive a hello message" "http://localhost:8000?prompt=hello"
  • get the data from cache, like: curl -X GET "http://localhost:8000?prompt=hello"

Currently the service is just a map cache, more functions are still under development.

What's Changed

Full Changelog: 0.1.15...0.1.16

Don't miss a new GPTCache release

NewReleases is sending notifications on new releases.