Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
rjmacarthy committed Apr 9, 2024
1 parent 7717d85 commit d993289
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
9 changes: 0 additions & 9 deletions src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,6 @@ export const DEFAULT_PROVIDER_FORM_VALUES = {
type: 'chat'
}

export const FIM_TEMPLATE_TYPE = [
'automatic',
'stable-code',
'codellama',
'deepseek',
'starcoder',
'custom-template'
]

export const WASM_LANGAUAGES: { [key: string]: string } = {
cpp: 'cpp',
hpp: 'cpp',
Expand Down
14 changes: 2 additions & 12 deletions src/extension/fim-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
STOP_DEEPSEEK,
STOP_LLAMA,
STOP_STARCODER,
STOP_CODEGEMMA,
STOP_CODEGEMMA
} from '../common/constants'
import { supportedLanguages } from '../common/languages'
import { FimPromptTemplate } from '../common/types'
Expand Down Expand Up @@ -74,19 +74,9 @@ export const getFimPromptTemplateStableCode = ({
}

export const getFimPromptTemplateCodegemma = ({
context,
header,
useFileContext,
prefixSuffix,
language
prefixSuffix
}: FimPromptTemplate) => {
const { prefix, suffix } = prefixSuffix
const languageId =
supportedLanguages[language as keyof typeof supportedLanguages]
const fileContext = useFileContext
? `${languageId?.syntaxComments?.start}${context}${languageId?.syntaxComments?.end}`
: ''
const heading = header ? header : ''
return `<|fim_prefix|>${prefix}<|fim_suffix|>${suffix}<|fim_middle|>`
}

Expand Down
4 changes: 2 additions & 2 deletions src/webview/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import styles from './providers.module.css'
import { TwinnyProvider } from '../extension/provider-manager'
import {
DEFAULT_PROVIDER_FORM_VALUES,
FIM_TEMPLATE_TYPE
FIM_TEMPLATE_FORMAT,
} from '../common/constants'

export const Providers = () => {
Expand Down Expand Up @@ -223,7 +223,7 @@ function ProviderForm({ onClose, provider }: ProviderFormProps) {
onChange={handleChangeDropdown}
value={formState.fimTemplate}
>
{FIM_TEMPLATE_TYPE.map((type, index) => (
{Object.values(FIM_TEMPLATE_FORMAT).map((type, index) => (
<VSCodeOption key={index} value={type || 'automatic'}>
{type}
</VSCodeOption>
Expand Down

0 comments on commit d993289

Please sign in to comment.