From 0bb35b5cef8450b5a5a37fbf70c385aaccf7a7bb Mon Sep 17 00:00:00 2001 From: Benedict Lee Date: Fri, 2 Feb 2024 13:48:05 +0900 Subject: [PATCH] change model name to case insensitive when selecting tab autocomplete template (#809) If the model name has capitalization, the model template is not applied correctly. So, change model name to case insensitive when selecting tab autocomplete template. --- core/autocomplete/templates.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/autocomplete/templates.ts b/core/autocomplete/templates.ts index 704653c13..015cd1b8f 100644 --- a/core/autocomplete/templates.ts +++ b/core/autocomplete/templates.ts @@ -45,23 +45,24 @@ The last line is incomplete, and you should provide the rest of that line. If th }; export function getTemplateForModel(model: string): AutocompleteTemplate { + const lowerCaseModel = model.toLowerCase() if ( - model.includes("starcoder") || - model.includes("star-coder") || - model.includes("stable") + lowerCaseModel.includes("starcoder") || + lowerCaseModel.includes("star-coder") || + lowerCaseModel.includes("stable") ) { return stableCodeFimTemplate; } - if (model.includes("codellama")) { + if (lowerCaseModel.includes("codellama")) { return codeLlamaFimTemplate; } - if (model.includes("deepseek")) { + if (lowerCaseModel.includes("deepseek")) { return deepseekFimTemplate; } - if (model.includes("gpt")) { + if (lowerCaseModel.includes("gpt")) { return gptAutocompleteTemplate; }