Skip to content

Commit

Permalink
fix displaying eval output to use an endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
aliasaria committed Oct 18, 2024
1 parent a700ef3 commit 059cb90
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/renderer/components/Experiment/Eval/ResultsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,20 @@ export default function ResultsModal({
if (open && experimentInfo && evaluator) {
const output_file = `plugins/${plugin}/output.txt`;
console.log('Fetching results from', output_file);
alert(
'I have broken this temporarily -- need to open the output.txt file in a different place'
);

fetch(
chatAPI.Endpoints.Experiment.GetFile(experimentInfo?.id, output_file)
chatAPI.Endpoints.Experiment.GetEvalOutput(
experimentInfo?.id,
evaluator
)
).then((res) => {
res.json().then((text) => {
setResultText(text);
});
if (res.ok) {
res.text().then((text) => {
setResultText(text);
});
} else {
setResultText('No results found');
}
});
}
});
Expand Down
7 changes: 7 additions & 0 deletions src/renderer/lib/transformerlab-api-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,13 @@ Endpoints.Experiment = {
'/evals/delete' +
'?eval_name=' +
evalName,
GetEvalOutput: (experimentId: string, eval_name: string) =>
API_URL() +
'experiment/' +
experimentId +
'/evals/get_output' +
'?eval_name=' +
eval_name,
RunExport: (
id: string,
pluginName: string,
Expand Down

0 comments on commit 059cb90

Please sign in to comment.