Parse a prompt template, and wrap it with meta template if applicable. Args: prompt_template (List[PromptType]): A prompt template (potentially before being wrapped by meta template). mode (str): Parsing mode. Choices are 'ppl' and 'gen'.
(self, prompt_template: PromptType, mode: str)
| 147 | """ |
| 148 | |
| 149 | def parse_template(self, prompt_template: PromptType, mode: str) -> str: |
| 150 | """Parse a prompt template, and wrap it with meta template if |
| 151 | applicable. |
| 152 | |
| 153 | Args: |
| 154 | prompt_template (List[PromptType]): A prompt |
| 155 | template (potentially before being wrapped by meta template). |
| 156 | mode (str): Parsing mode. Choices are 'ppl' and 'gen'. |
| 157 | |
| 158 | Returns: |
| 159 | str: The final string. |
| 160 | """ |
| 161 | return self.template_parser.parse_template(prompt_template, mode) |
| 162 | |
| 163 | def get_ppl_from_template(self, |
| 164 | templates: List[PromptType], |
no outgoing calls