diff --git a/package.json b/package.json index 0a7844a..7e2d1d8 100644 --- a/package.json +++ b/package.json @@ -113,13 +113,11 @@ "markdownDescription": "Select a model for the automatic mode based on your system specifications.", "enum": [ "base-small", - "base-medium", - "base-large" + "base-medium" ], "enumDescriptions": [ "Use if you have only CPU.", - "Use if you have standard GPU.", - "Use if you have enterprise GPU." + "Use if you have standard GPU." ] }, "firecoder.completion.manuallyMode": { @@ -128,13 +126,11 @@ "markdownDescription": "Select a model for the manually mode based on your system specifications.", "enum": [ "base-small", - "base-medium", - "base-large" + "base-medium" ], "enumDescriptions": [ "Use if you have only CPU.", - "Use if you have standard GPU.", - "Use if you have enterprise GPU." + "Use if you have standard GPU." ] }, "firecoder.experimental.useopentabs": { diff --git a/src/common/completion/index.ts b/src/common/completion/index.ts index 9854890..08c9a25 100644 --- a/src/common/completion/index.ts +++ b/src/common/completion/index.ts @@ -82,11 +82,11 @@ export const getInlineCompletionProvider = ( const parameters = triggerAuto ? { n_predict: 128, - stop: ["\n"], + stop: ["\n", "<|file_separator|>"], } : { n_predict: 512, - stop: [], + stop: ["<|file_separator|>"], temperature: 0.5, }; diff --git a/src/common/download/index.ts b/src/common/download/index.ts index 87f3037..86901b9 100644 --- a/src/common/download/index.ts +++ b/src/common/download/index.ts @@ -155,19 +155,14 @@ const getModelInfo = async ( ): Promise => { const models: Record = { "base-small": { - url: "https://huggingface.co/TheBloke/deepseek-coder-1.3b-base-GGUF/resolve/main/deepseek-coder-1.3b-base.Q8_0.gguf", + url: "https://huggingface.co/lmstudio-community/codegemma-2b-GGUF/resolve/main/codegemma-2b-Q5_K_M.gguf", checksum: - "9fcdcb283ef5b1d80ec7365b307c1ceab0c0f8ea079b49969f7febc06a11bccd", + "95f06d59cbf697da2fe9aa00b019c4f2e464718a956352ccbbb1cb436b98a2a7", }, "base-medium": { - url: "https://huggingface.co/TheBloke/deepseek-coder-6.7B-base-GGUF/resolve/main/deepseek-coder-6.7b-base.Q8_0.gguf", + url: "https://huggingface.co/lmstudio-community/codegemma-7b-GGUF/resolve/main/codegemma-7b-Q5_K_M.gguf", checksum: - "a2f82242ac5e465037cbf1ed754f04f0be044ee196e1589905f9e4dcd0e6559d", - }, - "base-large": { - url: "https://huggingface.co/TheBloke/deepseek-coder-33B-base-GGUF/resolve/main/deepseek-coder-33b-base.Q8_0.gguf", - checksum: - "9b9210b7de8c26d94773146613ee86844a714aae997223355bb520927627feff", + "eb00372705e7d5d30442750e8a7c72919c8e243bee52e1cce97fcfc1008c6143", }, "chat-small": { url: "https://huggingface.co/TheBloke/deepseek-coder-1.3b-instruct-GGUF/resolve/main/deepseek-coder-1.3b-instruct.Q8_0.gguf", @@ -263,7 +258,7 @@ export const downloadModel = async (typeModel: TypeModel) => { const modelFileInfo = await getModelInfo(typeModel); if (modelFileInfo === null) { - throw new Error("Server file info not found"); + throw new Error("Model file info not found"); } Logger.info(`Got model ${typeModel} file info`, { diff --git a/src/common/prompt/promptCompletion.ts b/src/common/prompt/promptCompletion.ts index dd86357..c9c2490 100644 --- a/src/common/prompt/promptCompletion.ts +++ b/src/common/prompt/promptCompletion.ts @@ -96,7 +96,7 @@ const processingDocumentWithPosition = async ({ tokenDifference <= maxDifference ) { return { - documentText: `${textBeforeSlice}<|fim▁hole|>${textAfterSlice}`, + documentText: `${textBeforeSlice}<|fim_suffix|>${textAfterSlice}`, documentTokens: tokens, }; } @@ -244,7 +244,13 @@ export const getPromptCompletion = async ({ ); additionalDocumentsText += - "\n" + getRelativePath(document.uri) + "\n" + documentText; + "https://github.com/" + + getRelativePath(document.uri) + + "\n" + + "<|fim_prefix|>" + + documentText + + "<|fim_middle|>" + + "<|file_separator|>"; restTokens -= documentTokens; } } @@ -252,9 +258,13 @@ export const getPromptCompletion = async ({ const activeDocumentFileName = additionalDocumentsText === "" ? "" - : "\n" + getRelativePath(activeDocument.uri) + "\n"; + : "\n" + + "https://github.com/" + + getRelativePath(activeDocument.uri) + + "\n" + + "<|fim_prefix|>"; - const prompt = `<|fim▁begin|>${additionalDocumentsText}${activeDocumentFileName}${activeDocumentText}<|fim▁end|>`; + const prompt = `${additionalDocumentsText}${activeDocumentFileName}${activeDocumentText}<|fim_middle|>`; return prompt; }; diff --git a/src/common/server/index.ts b/src/common/server/index.ts index 06e79c2..9438e87 100644 --- a/src/common/server/index.ts +++ b/src/common/server/index.ts @@ -14,9 +14,6 @@ const modelsBase = { "base-medium": { port: 39721, }, - "base-large": { - port: 39722, - }, }; export type TypeModelsBase = keyof typeof modelsBase; @@ -310,7 +307,6 @@ class Server { export const servers = { "base-small": new Server("base-small"), "base-medium": new Server("base-medium"), - "base-large": new Server("base-large"), "chat-small": new Server("chat-small"), "chat-medium": new Server("chat-medium"), "chat-large": new Server("chat-large"),