({
modelId,
datasetId,
}: {
modelId: string;
datasetId: string;
})
| 155 | |
| 156 | // Used for both fine-tuned and comparison models |
| 157 | export const startTestJobsForModel = async ({ |
| 158 | modelId, |
| 159 | datasetId, |
| 160 | }: { |
| 161 | modelId: string; |
| 162 | datasetId: string; |
| 163 | }) => { |
| 164 | const dataset = await prisma.dataset.findUniqueOrThrow({ |
| 165 | where: { |
| 166 | id: datasetId, |
| 167 | }, |
| 168 | }); |
| 169 | |
| 170 | const nodeEntriesToRun = await kysely |
| 171 | .selectFrom("NodeEntry as ne") |
| 172 | .innerJoin("DataChannel as dc", (join) => |
| 173 | join.onRef("dc.id", "=", "ne.dataChannelId").on("dc.destinationId", "=", dataset.nodeId), |
| 174 | ) |
| 175 | .where("ne.status", "=", "PROCESSED") |
| 176 | .where("ne.split", "=", "TEST") |
| 177 | .leftJoin("FineTuneTestingEntry as ftte", (join) => |
| 178 | join.onRef("ftte.inputHash", "=", "ne.inputHash").on("ftte.modelId", "=", modelId), |
| 179 | ) |
| 180 | .where("ftte.id", "is", null) |
| 181 | .select(["ne.id as nodeEntryId"]) |
| 182 | .execute(); |
| 183 | |
| 184 | await Promise.all( |
| 185 | nodeEntriesToRun.map((nodeEntry) => |
| 186 | generateTestSetEntry.enqueue({ |
| 187 | modelId, |
| 188 | nodeEntryId: nodeEntry.nodeEntryId, |
| 189 | numPreviousTries: 0, |
| 190 | }), |
| 191 | ), |
| 192 | ); |
| 193 | }; |
no outgoing calls
no test coverage detected