Added method for prompt generation from raw data#272
Added method for prompt generation from raw data#272alright-code wants to merge 4 commits intomainfrom
Conversation
| extract_cacher = ub.Cacher( | ||
| "generated_system_prompt_template_extract", | ||
| depends=self._cache_repr(self.dataset, self.extract_prompt), | ||
| enabled=self.enable_caching, |
There was a problem hiding this comment.
Oh interesting. So this enabled flag turns the caching on or off? Didn't know that was a feature and could simplify the caching code I have elsewhere.
| dialog.insert(0, DialogElement( | ||
| role='system', | ||
| content=self.per_attribute_templates[attribute]['system_prompt'])) | ||
| system_prompt_template = self.per_attribute_templates[attribute].get('system_prompt_template') |
There was a problem hiding this comment.
Hmm, I think this change (expecting a system_prompt_template instead of system_prompt) might break some existing configs. Would much prefer to support both as we do with the baseline component here: https://github.com/ITM-Kitware/align-system/blob/main/align_system/algorithms/outlines_baseline_adm_component.py#L74-L86
| if callable(system_prompt_template): | ||
| system_prompt = call_with_coerced_args( | ||
| system_prompt_template, | ||
| {'model':self.structured_inference_engine.model} |
There was a problem hiding this comment.
Wondering why we aren't initializing this component with structured_inference_engine and instead opting to pass in the model and create a new generator (looks like we're just passing in the structured_inference_engine.model anyway). Are there parameters that need to be different or are we otherwise invoking this differently that makes this necessary? The main detractor to doing it this way is that we can't freely swap out the inference engine backend.
There was a problem hiding this comment.
This file probably makes more sense to go into the prompt_engineering directory (instead of algorithms)
Two phase approach for prompt generation:
phase2_direct_gen.yaml shows how this can be configured for medical kdma.