FIX: GPTCache cache_obj creation loop (#4827)

_get_gptcache method keep creating new gptcache instance, here's the fix

# Fix GPTCache cache_obj creation loop

Fixes #4830 

Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
This commit is contained in:
elBarkey 2023-05-18 23:42:35 +07:00 committed by GitHub
parent c9e2a01875
commit a8ded21b69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -341,6 +341,8 @@ class GPTCache(BaseCache):
pre_embedding_func=get_prompt, pre_embedding_func=get_prompt,
data_manager=get_data_manager(data_path=llm_string), data_manager=get_data_manager(data_path=llm_string),
) )
self.gptcache_dict[llm_string] = _gptcache
return _gptcache return _gptcache
def _get_gptcache(self, llm_string: str) -> Any: def _get_gptcache(self, llm_string: str) -> Any: