promptslab / Promptify

Prompt Engineering | Prompt Versioning | Use GPT or other prompt based models to get structured output. Join our discord for Prompt-Engineering, LLMs and other latest research
https://discord.gg/m88xfYMbK6
Apache License 2.0
3.21k stars 238 forks source link

cache prompt variables #32

Open SeanLee97 opened 1 year ago

SeanLee97 commented 1 year ago

The prompt variables are obtained in real-time when calling the fit function in the previous implementation. It might be inefficient because the fit() tends to be called multiple times in handling various sentences. Caching the prompt variables in a hashmap can curtail the overhead.

SeanLee97 commented 1 year ago
Screen Shot 2023-02-22 at 23 25 37

Test case passed