Skip to content

Commit

Permalink
just redecleare the key
Browse files Browse the repository at this point in the history
  • Loading branch information
vinid committed Jul 14, 2024
1 parent 0ba66ad commit 569fca6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions textgrad/engine/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ def single_prompt_generate(self, prompt: str, system_prompt: str=None, **kwargs)
def multimodal_generate(self, content: List[Union[str, bytes]], system_prompt: str = None, **kwargs):

sys_prompt_arg = system_prompt if system_prompt else self.system_prompt
key = "".join([str(k) for k in content])
if self.do_cache:
key = "".join([str(k) for k in content])

cache_key = sys_prompt_arg + key
cache_or_none = self._check_cache(cache_key)
if cache_or_none is not None:
Expand All @@ -96,6 +95,7 @@ def multimodal_generate(self, content: List[Union[str, bytes]], system_prompt: s
response = self._generate_from_multiple_input(content, system_prompt=sys_prompt_arg, **kwargs)

if self.do_cache:
cache_key = sys_prompt_arg + key
self._save_cache(cache_key, response)

return response
Expand Down

0 comments on commit 569fca6

Please sign in to comment.