-
Couldn't load subscription status.
- Fork 57
feat: modify GeneratePrompt transform to take placeholder_dict #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* feat: add SaveStrategy to allow flexibility in saving localized evaluation outputs (#281) * feat: modify GeneratePrompt transform to take placeholder_dict (#288) * feat: modify GeneratePrompt transform to take placeholder_dict * fix: unit test * fix: requested changes --------- Co-authored-by: keerthanvasist <[email protected]> Co-authored-by: Xiaoyi Cheng <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @xiaoyi-cheng, I missed this small detail when reviewing your PR last week. I added a comment for record-keeping purposes. I'll submit a PR to fix this soon.
| """ | ||
| super().__init__(input_keys, output_keys, prompt_template) | ||
| super().__init__(input_keys, output_keys, prompt_template, placeholder_to_record_key) | ||
| self.register_input_output_keys(input_keys, output_keys) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoot, I didn't catch this before the PR got merged, but we will need to update the call to self.register_input_output_keys to handle the case where placeholder_to_record_key is non-null.
input_keys_to_register = list(placeholder_to_record_keys.values()) if placeholder_to_record_key else input_keys
self.register_input_output_keys(input_keys_to_register, output_keys)
Issue #, if available:
Currently GeneratePrompt transform can only substitute default placeholder
$model_inputwithdatafield.This PR will support
placeholder_data_dict(#273)Description of changes:
placeholder_keys_dictwill be placeholder keys to input keys mapping, but in this way it only supports transform 1 prompt with one placeholder dict. See unit test for use caseBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.