You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromgptcacheimportCachefromgptcache.adapter.apiimportinit_similar_cachefromlangchain.cacheimportGPTCache# Avoid multiple caches using the same file, causing different llm model caches to affect each otherdefinit_gptcache(cache_obj: Cache, llmstr):
init_similar_cache(cache_obj=cache_obj, data_dir=f"similar_cache_{llm}")
langchain.llm_cache=GPTCache(init_gptcache)
llm=OpenAI(model_name="text-davinci-002", temperature=0.2)
llm("tell me a joke")
print("cached:", langchain.llm_cache.lookup("tell me a joke", llm_string))
# cached: None
the cache won't hits
Expected behavior
the gptcache should have a hit
The text was updated successfully, but these errors were encountered:
System Info
Langchain Version: 0.0.170
Platform: Linux X86_64
Python: 3.9
Who can help?
@SimFG
No response
Information
Related Components
Reproduction
Steps to produce behaviour:
the cache won't hits
Expected behavior
the gptcache should have a hit
The text was updated successfully, but these errors were encountered: