Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: remove temperature scaling #67

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/cli/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const command = program
)
.option(
"-p, --port <port>",
"port to run the IPC server on (default: 3000)",
"port to run the IPC server on",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the default in the description is redundant (commander adds it automatically) so I removed it

(val) => parseInt(val),
3000,
)
Expand Down
12 changes: 2 additions & 10 deletions packages/bumpgen-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ const bumpgen = ({
const { graphService } = services;
return graphService.plan.nodes.nextPending(graph.plan) === undefined;
},
execute: async (graph: BumpgenGraph, temperature: number) => {
execute: async (graph: BumpgenGraph, temperature = 0.2) => {
const { llm, graphService, language } = services;
const { packageToUpgrade } = args;
const planNode = graphService.plan.nodes.nextPending(graph.plan);
Expand Down Expand Up @@ -453,15 +453,7 @@ const bumpgen = ({
type: "graph.plan.execute" as const,
status: "started" as const,
};
const iterationResult = await bumpgen.graph.plan.execute(
graph,
Math.min(
iteration > maxIterations / 2
? 0.2 * Math.exp(0.3 * (iteration - maxIterations / 2))
: 0.2,
2,
),
);
const iterationResult = await bumpgen.graph.plan.execute(graph);
if (!iterationResult) {
break;
}
Expand Down
15 changes: 4 additions & 11 deletions scripts/src/eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { exec } from "child_process";
import { existsSync, readFileSync } from "fs";
import { writeFile } from "fs/promises";
import { program } from "@commander-js/extra-typings";
import { injectGitService, makeBumpgen } from "@xeol/bumpgen-core";
import { z } from "zod";

import { injectGitService, makeBumpgen } from "@xeol/bumpgen-core";

export const PredictionSchema = z.object({
// the name of the model that generated the prediction
modelName: z.string(),
Expand Down Expand Up @@ -129,23 +130,15 @@ program
if (errors.length === 0) break;

const graph = bumpgen.graph.initialize(errors);
const temperature = Math.min(
iterations > maxIterations / 2
? 0.2 * Math.exp(0.15 * (iterations - maxIterations / 2))
: 0.2,
1,
);

console.log(
`ITERATION ${iterations} of ${maxIterations} with temperation ${temperature}`,
);

let iterationResult;

do {
iterationResult = await bumpgen.graph.plan.execute(
graph,
temperature,
);
iterationResult = await bumpgen.graph.plan.execute(graph);
if (!iterationResult) break;
} while (iterationResult);

Expand Down
Loading