move finetuned dataset annotation to modelName

This commit is contained in:
Jacob Kim 2025-07-03 14:22:43 -07:00
parent cbd54b2914
commit e8d182b6e4
4 changed files with 3 additions and 80 deletions

View file

@ -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;

View file

@ -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 {

View file

@ -19,5 +19,4 @@ export const nextEditOutcomeEventAllSchema = baseDevDataAllSchema.extend({
accepted: z.boolean().optional(),
modelProvider: z.string(),
modelName: z.string(),
finetunedOn: z.string(),
});

View file

@ -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 =