(
self,
oneshot_example: List[str], # User prompt + Assistant responce
system_inst,
role1,
role2,
sen_spliter="\n",
qa_spliter="\n",
decorator: List[str] = None,
)
| 95 | |
| 96 | class OneShotBasePrompter(BasePrompter): |
| 97 | def __init__( |
| 98 | self, |
| 99 | oneshot_example: List[str], # User prompt + Assistant responce |
| 100 | system_inst, |
| 101 | role1, |
| 102 | role2, |
| 103 | sen_spliter="\n", |
| 104 | qa_spliter="\n", |
| 105 | decorator: List[str] = None, |
| 106 | ): |
| 107 | super().__init__(system_inst, role1, role2, sen_spliter, qa_spliter) |
| 108 | assert len(oneshot_example) == 2, "One-shot example must be a List of 2 strs." |
| 109 | self.user_example = oneshot_example[0] |
| 110 | self.assistant_example = oneshot_example[1] |
| 111 | self.insert_prompt(self.user_example) |
| 112 | self.update_template(self.assistant_example) |
| 113 | |
| 114 | |
| 115 | class VicunaPrompter(BasePrompter): |
nothing calls this directly
no test coverage detected