MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / __init__

Method __init__

inference/utils/prompt_templates.py:97–112  ·  view source on GitHub ↗
(
        self,
        oneshot_example: List[str],  # User prompt + Assistant responce
        system_inst,
        role1,
        role2,
        sen_spliter="\n",
        qa_spliter="\n",
        decorator: List[str] = None,
    )

Source from the content-addressed store, hash-verified

95
96class 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
115class VicunaPrompter(BasePrompter):

Callers

nothing calls this directly

Calls 3

__init__Method · 0.45
insert_promptMethod · 0.45
update_templateMethod · 0.45

Tested by

no test coverage detected