Closed mayalinetsky-kryon closed 7 months ago
Found the problem:
Because I've run the script twice: one with similarity 0 and one with similarity 0.95, without deleting the database, the cache contained "updated" answers that were from the first run, meaning in the second run I DID get a cache hit but the answer was not what I originally manually saved in the cache during the import, resulting in a "negative cache hit".
Current Behavior
I took the code from the benchmark example here and added the
cache.set_azure_openai_key()
static method after init and adding the needed environment variables for azure. The code now looks like this:After running the script I see there are no positive cache hits at all, and all "res_text" values are a full answer resulting from a new request from azure.
Expected Behavior
Because the similarity threshold is quite high (95), I was expecting to get at least some hits, especially for the first question in the mock data: "origin": "Hugging Face Hub is a platform to host Git-based models, datasets, and Spaces." "similar": "Hugging Face Hub serves as a repository for Git-based models, datasets, and Spaces."
And even increasing the threshold to 1 doesn't get me cache hits.
Steps To Reproduce
No response
Environment
No response
Anything else?
No response