Skip to content

Commit

Permalink
Merge pull request #369 from twinnydotdev/development
Browse files Browse the repository at this point in the history
development > main
  • Loading branch information
rjmacarthy authored Nov 2, 2024
2 parents 5049404 + c9d523c commit 57cc2ae
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "twinny",
"displayName": "twinny - AI Code Completion and Chat",
"description": "Locally hosted AI code completion plugin for vscode",
"version": "3.18.2",
"version": "3.18.3",
"icon": "assets/icon.png",
"keywords": [
"code-inference",
Expand Down
20 changes: 18 additions & 2 deletions src/extension/fim-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,25 @@ const getFimPromptTemplateCodestral = ({
return `${fileContext}\n\n[SUFFIX]${suffix}[PREFIX]${heading}${prefix}`
}

const getFimPromptTemplateQwen = ({ prefixSuffix }: FimPromptTemplate) => {
const getFimPromptTemplateQwen = ({
context,
header,
fileContextEnabled,
prefixSuffix,
language
}: FimPromptTemplate) => {
const { prefix, suffix } = prefixSuffix
return `<|fim_prefix|>${prefix}<|fim_suffix|>${suffix}<|fim_middle|>`
const { fileContext, heading } = getFileContext(
fileContextEnabled,
context,
language,
header
)
if (fileContextEnabled) {
return `<|file_sep|>${fileContext}\n\n<|file_sep|>${heading}<|fim_prefix|>${prefix}<|fim_suffix|>${suffix}<|fim_middle|>`
} else {
return `<|fim_prefix|>${prefix}<|fim_suffix|>${suffix}<|fim_middle|>`
}
}

const getFimPromptTemplateOther = ({
Expand Down

0 comments on commit 57cc2ae

Please sign in to comment.