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

Function get_prompter

inference/utils/prompt_templates.py:218–235  ·  view source on GitHub ↗
(model_type, model_path="", short_prompt=False)

Source from the content-addressed store, hash-verified

216
217
218def get_prompter(model_type, model_path="", short_prompt=False):
219 if model_type.lower() == "llama":
220 if "vicuna" in model_path:
221 return VicunaPrompter()
222 else:
223 return Llama2Prompter(short_prompt)
224 elif model_type.lower() == "falcon":
225 # return FalconPrompter()
226 return FalconSimplePrompter()
227 elif model_type.lower() == "mpt":
228 if "mpt" and "chat" in model_path:
229 return MPTChatPrompter()
230 else:
231 return MPTPrompter()
232 elif model_type.lower() == "metamath":
233 return MetaMathPrompter()
234 else:
235 raise ValueError(f"model type {model_type} is not supported")
236
237
238def get_stop_token_ids(model_type, model_path=""):

Callers 1

demo.pyFile · 0.90

Calls 6

VicunaPrompterClass · 0.85
Llama2PrompterClass · 0.85
MPTChatPrompterClass · 0.85
MPTPrompterClass · 0.85
MetaMathPrompterClass · 0.85

Tested by

no test coverage detected