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
I am utilizing the GPT Semantic Cache as outlined in the Langchain documentation, combined with the Groq API and the Llama3-70b-8192 model. However, I'm encountering an issue where the semantic cache returns the same response repeatedly, even when different questions are asked.
Can anybody know what could be the possible cause?
Here is the code:
import hashlib
from gptcache import Cache
from gptcache.adapter.api import init_similar_cache
from langchain.cache import GPTCache
from langchain_core.globals import set_llm_cache
according to langchain documentation of Semantic GPTCache I did not see any vector store utilization?
can you please guide me or share any link from where i can get it correctly?
here is the link of langchain doc of Semantic GPTCache: https://python.langchain.com/docs/integrations/llm_caching/#gptcache
I am utilizing the GPT Semantic Cache as outlined in the Langchain documentation, combined with the Groq API and the Llama3-70b-8192 model. However, I'm encountering an issue where the semantic cache returns the same response repeatedly, even when different questions are asked.
Can anybody know what could be the possible cause?
Here is the code:
import hashlib
from gptcache import Cache
from gptcache.adapter.api import init_similar_cache
from langchain.cache import GPTCache
from langchain_core.globals import set_llm_cache
def get_hashed_name(name):
return hashlib.sha256(name.encode()).hexdigest()
def init_gptcache(cache_obj: Cache, llm: str):
hashed_llm = get_hashed_name(llm)
init_similar_cache(cache_obj=cache_obj, data_dir=f"similar_cache_{hashed_llm}")
set_llm_cache(GPTCache(init_gptcache))
The text was updated successfully, but these errors were encountered: