Skip to content

Commit

Permalink
changes for context window experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
hitesh-1997 committed Oct 3, 2024
1 parent d7bebb3 commit 62b590e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 14 deletions.
2 changes: 1 addition & 1 deletion vscode/src/completions/inline-completion-item-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ export class InlineCompletionItemProvider
takeSuggestWidgetSelectionIntoAccount,
undefined
)
completion.requestParams.docContext.position

if (isStillVisible) {
suggestionEvent.markAsRead({
document: invokedDocument,
Expand Down
9 changes: 9 additions & 0 deletions vscode/src/completions/providers/fireworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import {
export const DEEPSEEK_CODER_V2_LITE_BASE = 'deepseek-coder-v2-lite-base'
// Context window experiments with DeepSeek Model
export const DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_4096 = 'deepseek-coder-v2-lite-base-context-4096'
export const DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_8192 = 'deepseek-coder-v2-lite-base-context-8192'
export const DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_16384 = 'deepseek-coder-v2-lite-base-context-16384'

export const CODE_QWEN_7B_V2P5 = 'code-qwen-7b-v2p5'

// Model identifiers can be found in https://docs.fireworks.ai/explore/ and in our internal
Expand All @@ -36,6 +39,8 @@ const MODEL_MAP = {
'llama-code-13b': 'fireworks/accounts/fireworks/models/llama-v2-13b-code',
[DEEPSEEK_CODER_V2_LITE_BASE]: 'fireworks/deepseek-coder-v2-lite-base',
[DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_4096]: 'accounts/fireworks/models/deepseek-coder-v2-lite-base',
[DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_8192]: 'accounts/fireworks/models/deepseek-coder-v2-lite-base',
[DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_16384]: 'accounts/fireworks/models/deepseek-coder-v2-lite-base',
[CODE_QWEN_7B_V2P5]: 'accounts/fireworks/models/qwen-v2p5-7b',
} as const

Expand Down Expand Up @@ -64,6 +69,10 @@ function getMaxContextTokens(model: FireworksModel): number {
}
case DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_4096:
return 4096
case DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_8192:
return 8192
case DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_16384:
return 16384
default:
return 1200
}
Expand Down
44 changes: 31 additions & 13 deletions vscode/src/completions/providers/shared/get-experiment-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
CODE_QWEN_7B_V2P5,
DEEPSEEK_CODER_V2_LITE_BASE,
DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_4096,
DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_8192,
DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_16384,
} from '../fireworks'

interface ProviderConfigFromFeatureFlags {
Expand Down Expand Up @@ -86,22 +88,38 @@ function resolveFIMModelExperimentFromFeatureFlags(): ReturnType<typeof getDotCo
return combineLatest(
featureFlagProvider.evaluatedFeatureFlag(FeatureFlag.CodyAutocompleteFIMModelExperimentControl),
featureFlagProvider.evaluatedFeatureFlag(FeatureFlag.CodyAutocompleteFIMModelExperimentVariant1),
featureFlagProvider.evaluatedFeatureFlag(FeatureFlag.CodyAutocompleteFIMModelExperimentVariant2)
featureFlagProvider.evaluatedFeatureFlag(FeatureFlag.CodyAutocompleteFIMModelExperimentVariant2),
featureFlagProvider.evaluatedFeatureFlag(FeatureFlag.CodyAutocompleteFIMModelExperimentVariant3),
featureFlagProvider.evaluatedFeatureFlag(FeatureFlag.CodyAutocompleteFIMModelExperimentVariant4)
).pipe(
map(([fimModelControl, fimModelVariant1, fimModelVariant2]) => {
if (fimModelVariant1) {
return { provider: 'fireworks', model: DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_4096 }
}
if (fimModelVariant2) {
return { provider: 'fireworks', model: CODE_QWEN_7B_V2P5 }
}
if (fimModelControl) {
// Current production model
map(
([
fimModelControl,
fimModelVariant1,
fimModelVariant2,
fimModelVariant3,
fimModelVariant4,
]) => {
if (fimModelVariant1) {
return { provider: 'fireworks', model: DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_4096 }
}
if (fimModelVariant2) {
return { provider: 'fireworks', model: CODE_QWEN_7B_V2P5 }
}
if (fimModelVariant3) {
return { provider: 'fireworks', model: DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_8192 }
}
if (fimModelVariant4) {
return { provider: 'fireworks', model: DEEPSEEK_CODER_V2_LITE_BASE_WINDOW_16384 }
}
if (fimModelControl) {
// Current production model
return { provider: 'fireworks', model: DEEPSEEK_CODER_V2_LITE_BASE }
}
// Extra free traffic - redirect to the current production model which could be different than control
return { provider: 'fireworks', model: DEEPSEEK_CODER_V2_LITE_BASE }
}
// Extra free traffic - redirect to the current production model which could be different than control
return { provider: 'fireworks', model: DEEPSEEK_CODER_V2_LITE_BASE }
}),
),
distinctUntilChanged()
)
}

0 comments on commit 62b590e

Please sign in to comment.