textgrad icon indicating copy to clipboard operation
textgrad copied to clipboard

Turn off cache in Textgrad

Open XuGW-Kevin opened this issue 1 year ago • 3 comments

It seems that currently if we input the same prompt twice, for the second time Textgrad will automatically use the cached engine and return the cached results. However, in some cases, we want to generate different results each time. Therefore, can we add cache_result to the initialization of Textgrad Engine, so that it will cache results only if we set cache_result=True ?

XuGW-Kevin avatar Aug 12 '24 14:08 XuGW-Kevin

Definitely, and caching should be made explicit! It took me a while to figure it out...

belmarca avatar Aug 14 '24 13:08 belmarca

For anyone looking to fix this, I temporarily nuke the cache. Here's an example on Debian:

rm -rf ~/.cache/textgrad/

belmarca avatar Aug 14 '24 19:08 belmarca

We agree with this. A priority led by @vinid will be to unify and improve our engine interface using LiteLLM or a package like this, and we will fix this. This comes from the research origins of the paper, and we will make it more usable!

mertyg avatar Aug 29 '24 15:08 mertyg

This should be supported by the new engines! Let us know if they work as expected!

vinid avatar Jan 24 '25 14:01 vinid