Skip to content
Merged
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
5 changes: 4 additions & 1 deletion src/eval_utils/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import cliProgress from "cli-progress";
import { Humanloop, HumanloopClient } from "index";
import _ from "lodash";
import pMap from "p-map";

import {
BooleanEvaluatorStatsResponse,
Expand Down Expand Up @@ -484,6 +483,10 @@ export async function runEval(
);
const totalDatapoints = hlDataset.datapoints!.length;
progressBar.start(totalDatapoints, 0);

// p-map is esm only since v5. Since we're targeting cjs, we need to
// import it dynamically, so it works for both cjs and esm consumers on node < 22.
const { default: pMap } = await import("p-map");
await pMap(
hlDataset.datapoints!,
async (datapoint) => {
Expand Down