| 566 | modelId2: string; |
| 567 | }) => { |
| 568 | const getOutputHash = async ({ modelId }: { modelId: string }) => { |
| 569 | if (modelId !== ORIGINAL_MODEL_ID) { |
| 570 | return kysely |
| 571 | .selectFrom("FineTuneTestingEntry as ftte") |
| 572 | .where("ftte.modelId", "=", modelId) |
| 573 | .where("ftte.inputHash", "=", nodeEntry.inputHash) |
| 574 | .leftJoin("FineTune as ft", "ft.id", "ftte.fineTuneId") |
| 575 | .innerJoin("DatasetEntryOutput as deo", "deo.hash", "ftte.outputHash") |
| 576 | .select(["ftte.outputHash"]) |
| 577 | .executeTakeFirst() |
| 578 | .then((entry) => entry?.outputHash); |
| 579 | } else { |
| 580 | return kysely |
| 581 | .selectFrom("NodeEntry as ne") |
| 582 | .where("ne.id", "=", nodeEntry.id) |
| 583 | .select(["ne.outputHash"]) |
| 584 | .executeTakeFirst() |
| 585 | .then((entry) => entry?.outputHash); |
| 586 | } |
| 587 | }; |
| 588 | |
| 589 | // Ensure output has already been generated |
| 590 | const [existingFirstOutputHash, existingSecondOutputHash] = await Promise.all([ |