(model_type, model_path="", short_prompt=False)
| 216 | |
| 217 | |
| 218 | def 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 | |
| 238 | def get_stop_token_ids(model_type, model_path=""): |
no test coverage detected