From e8d182b6e4c3e32885b8adb034f73df632f78b72 Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Thu, 3 Jul 2025 14:22:43 -0700 Subject: [PATCH] move finetuned dataset annotation to modelName --- core/nextEdit/NextEditProvider.ts | 79 +------------------ core/nextEdit/types.ts | 2 - .../src/schemas/data/nextEditOutcome/index.ts | 1 - .../schemas/data/nextEditOutcome/v0.2.0.ts | 1 - 4 files changed, 3 insertions(+), 80 deletions(-) diff --git a/core/nextEdit/NextEditProvider.ts b/core/nextEdit/NextEditProvider.ts index a46ee2b70..fba86df33 100644 --- a/core/nextEdit/NextEditProvider.ts +++ b/core/nextEdit/NextEditProvider.ts @@ -244,45 +244,17 @@ export class NextEditProvider { } else { const promptMetadata = renderPrompt(helper, this.diffContext); this.promptMetadata = promptMetadata; - prompts.push( - // await renderFineTunedUserPrompt(snippetPayload, this.ide, helper), - // await renderFineTunedBasicUserPrompt( - // snippetPayload, - // this.ide, - // helper, - // this.diffContext, - // ), - promptMetadata.prompt, - ); + prompts.push(promptMetadata.prompt); } if (this.endpointType === "default") { const msg: ChatMessage = await llm.chat(prompts, token); if (typeof msg.content === "string") { const nextCompletion = JSON.parse(msg.content).newCode; - // const outcomeNext: AutocompleteOutcome = { - // time: Date.now() - startTime, - // completion: nextCompletion, - // prefix: "", - // suffix: "", - // prompt: "", - // modelProvider: llm.underlyingProviderName, - // modelName: llm.model, - // completionOptions: null, - // cacheHit: false, - // filepath: helper.filepath, - // numLines: nextCompletion.split("\n").length, - // completionId: helper.input.completionId, - // gitRepo: await this.ide.getRepoName(helper.filepath), - // uniqueId: await this.ide.getUniqueId(), - // timestamp: Date.now(), - // ...helper.options, - // }; - // TODO: clean this up, or delete. const outcomeNext: NextEditOutcome = { elapsed: Date.now() - startTime, modelProvider: llm.underlyingProviderName, - modelName: llm.model, + modelName: llm.model + ":zetaDataset", completionOptions: null, // filepath: helper.filepath, completionId: helper.input.completionId, @@ -298,36 +270,13 @@ export class NextEditProvider { originalEditableRange: "", completion: nextCompletion, cursorPosition: helper.pos, - finetunedOn: "zetaDataset", ...helper.options, }; return outcomeNext; } else { return undefined; } - // const body = { - // model: defaultModel, - // messages: prompts, - // // max_tokens: 15000, - // // stop: ["<|editable_region_end|>"], - // }; - // - // const resp = await fetch(defaultEndpoint, { - // method: "POST", - // headers: { - // Authorization: `Bearer ${mercuryToken} `, - // "Content-Type": "application/json", - // }, - // body: JSON.stringify(body), - // }); - // - // const respJson = await resp.json(); - - // TODO: Do some zod schema validation here if needed. } else { - // const testController = new AbortController(); - // const msg: ChatMessage = await llm.chat(prompts, testController.signal); - // const testToken = testController.signal; const msg: ChatMessage = await llm.chat(prompts, token); if (typeof msg.content === "string") { // TODO: There are cases where msg.conetnt.split("<|start|>")[1] is undefined @@ -335,27 +284,6 @@ export class NextEditProvider { msg.content.split("<|editable_region_start|>\n")[1], ).replace(/\n$/, ""); - // const diffLines = myersDiff(helper.fileContents, nextCompletion); - - // const diff = getRenderableDiff(diffLines); - // const outcomeNext: AutocompleteOutcome = { - // time: Date.now() - startTime, - // completion: nextCompletion, - // prefix: "", - // suffix: "", - // prompt: "", - // modelProvider: llm.underlyingProviderName, - // modelName: llm.model, - // completionOptions: null, - // cacheHit: false, - // filepath: helper.filepath, - // numLines: nextCompletion.split("\n").length, - // completionId: helper.input.completionId, - // gitRepo: await this.ide.getRepoName(helper.filepath), - // uniqueId: await this.ide.getUniqueId(), - // timestamp: Date.now(), - // ...helper.options, - // }; const currCursorPos = helper.pos; const editableRegionStartLine = Math.max( currCursorPos.line - NEXT_EDIT_EDITABLE_REGION_TOP_MARGIN, @@ -373,7 +301,7 @@ export class NextEditProvider { const outcomeNext: NextEditOutcome = { elapsed: Date.now() - startTime, modelProvider: llm.underlyingProviderName, - modelName: llm.model, + modelName: llm.model + ":zetaDataset", completionOptions: null, // filepath: helper.filepath, completionId: helper.input.completionId, @@ -389,7 +317,6 @@ export class NextEditProvider { originalEditableRange: oldEditRangeSlice, completion: nextCompletion, cursorPosition: helper.pos, - finetunedOn: "zetaDataset", ...helper.options, }; return outcomeNext; diff --git a/core/nextEdit/types.ts b/core/nextEdit/types.ts index 4a47951f2..0837c5494 100644 --- a/core/nextEdit/types.ts +++ b/core/nextEdit/types.ts @@ -54,8 +54,6 @@ export interface NextEditOutcome extends TabAutocompleteOptions { completion: string; cursorPosition: { line: number; character: number }; accepted?: boolean; - // model: string; - finetunedOn: string; } export interface PromptMetadata { diff --git a/packages/config-yaml/src/schemas/data/nextEditOutcome/index.ts b/packages/config-yaml/src/schemas/data/nextEditOutcome/index.ts index 34901b21d..f294b1068 100644 --- a/packages/config-yaml/src/schemas/data/nextEditOutcome/index.ts +++ b/packages/config-yaml/src/schemas/data/nextEditOutcome/index.ts @@ -19,5 +19,4 @@ export const nextEditOutcomeEventAllSchema = baseDevDataAllSchema.extend({ accepted: z.boolean().optional(), modelProvider: z.string(), modelName: z.string(), - finetunedOn: z.string(), }); diff --git a/packages/config-yaml/src/schemas/data/nextEditOutcome/v0.2.0.ts b/packages/config-yaml/src/schemas/data/nextEditOutcome/v0.2.0.ts index b5acae398..82e4edbea 100644 --- a/packages/config-yaml/src/schemas/data/nextEditOutcome/v0.2.0.ts +++ b/packages/config-yaml/src/schemas/data/nextEditOutcome/v0.2.0.ts @@ -28,7 +28,6 @@ export const nextEditOutcomeEventSchema_0_2_0 = accepted: true, modelProvider: true, modelName: true, - finetunedOn: true, }); export const nextEditOutcomeEventSchema_0_2_0_noCode =