Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tssweeney committed Dec 21, 2024
1 parent f0ba3b4 commit f9ac9d8
Showing 1 changed file with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
*/

import {sum} from 'lodash';
import _ from 'lodash';
import {useEffect, useMemo, useRef, useState} from 'react';

import {WB_RUN_COLORS} from '../../../../../../common/css/color.styles';
Expand Down Expand Up @@ -473,19 +474,26 @@ const fetchEvaluationComparisonResults = async (
const predictAndScoreIds = predictAndScoreCallRes.calls.map(
call => call.id
);
return traceServerClient
.callsStreamQuery({
project_id: projectId,
filter: {trace_ids: evalTraceIds, parent_ids: predictAndScoreIds},

return Promise.all(
_.chunk(predictAndScoreIds, 500).map(chunk => {
return traceServerClient
.callsStreamQuery({
project_id: projectId,
filter: {trace_ids: evalTraceIds, parent_ids: chunk},
})
.then(predictionsAndScoresCallsRes => {
return predictionsAndScoresCallsRes.calls;
});
})
.then(predictionsAndScoresCallsRes => {
return {
calls: [
...predictAndScoreCallRes.calls,
...predictionsAndScoresCallsRes.calls,
],
};
});
).then(predictionsAndScoresCallsResMany => {
return {
calls: [
...predictAndScoreCallRes.calls,
...predictionsAndScoresCallsResMany.flat(),
],
};
});
});

// 3.5 Populate the inputs
Expand Down

0 comments on commit f9ac9d8

Please sign in to comment.