Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(prompt/mixin): Add name property and add it to saving/loading pat…
…h. (explodinggradients#1853) This pull request includes several changes to the `PromptMixin` class in the `src/ragas/prompt/mixin.py` file. The changes focus on adding a `name` attribute to the class and using this attribute when saving and loading prompts. This solves the error when saving and loading several prompts of different Synthesizers (e.g. MultiHopAbstractQuerySynthesizer, MultiHopSpecificQuerySynthesizer, SingleHopSpecificQuerySynthesizer etc.) as they had the same path associated: ``` themes_personas_matching_prompt_english -> single_hop_specifc_query_synthesizer_themes_personas_matching_prompt_english query_answer_generation_prompt_english -> single_hop_specifc_query_synthesizer_query_answer_generation_prompt_english ``` ### Changes to `PromptMixin` class: * Added a `name` attribute to the `PromptMixin` class. * Modified the `save_prompts` method to include the `name` attribute in the prompt file name. * Modified the `load_prompts` method to include the `name` attribute in the prompt file name. --------- Co-authored-by: jjmachan <[email protected]> Co-authored-by: Jithin James <[email protected]>
- Loading branch information