fixed the bug #8343 (#8345)

- Issue: #8343

Signed-off-by: Pranay Chandekar <pranayc6@gmail.com>
eugene/expand_documentation^2
Pranay Chandekar 1 year ago committed by GitHub
parent 934ea80780
commit 41bb3a6f9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -445,8 +445,10 @@ class GPTCache(BaseCache):
"""Get a cache object.
When the corresponding llm model cache does not exist, it will be created."""
return self.gptcache_dict.get(llm_string, self._new_gptcache(llm_string))
_gptcache = self.gptcache_dict.get(llm_string, None)
if not _gptcache:
_gptcache = self._new_gptcache(llm_string)
return _gptcache
def lookup(self, prompt: str, llm_string: str) -> Optional[RETURN_VAL_TYPE]:
"""Look up the cache data.

Loading…
Cancel
Save