chore: display available clusters

This commit is contained in:
jialin
2025-09-16 20:32:26 +08:00
parent c9c9401b0b
commit d063dfd652
14 changed files with 121 additions and 39 deletions
+19 -19
View File
@@ -376,23 +376,23 @@ export async function evaluationsModelSpec(
},
options: { token: any }
) {
return request<{ results: EvaluateResult[] }>(`${MODEL_EVALUATIONS}`, {
method: 'POST',
data,
cancelToken: options?.token
});
}
const result = await request<{ results: EvaluateResult[] }>(
`${MODEL_EVALUATIONS}`,
{
method: 'POST',
data,
cancelToken: options?.token
}
);
// export const evaluationsModelSpec = async (
// data: {
// model_specs: EvaluateSpec[];
// },
// options: { token: any }
// ) => {
// const response = await fetch(`v1/${MODEL_EVALUATIONS}`, {
// method: 'POST',
// headers: { 'Content-Type': 'application/json' },
// body: JSON.stringify(data)
// });
// return response.json();
// };
const resultList = result?.results || [];
return {
results: resultList.map((item) => {
return {
...item,
cluster_id: data.model_specs?.[0]?.cluster_id || undefined
};
})
};
}