From d7f4b531ec2e9348f1203de3abbcede7ca03ca61 Mon Sep 17 00:00:00 2001 From: Arjun Attam Date: Wed, 3 Apr 2024 10:54:36 +0530 Subject: [PATCH] fix: python scorer should prefer config.name (#67) --- .changeset/quick-plants-occur.md | 5 +++++ packages/scorer/src/provider/deterministic/script.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/quick-plants-occur.md diff --git a/.changeset/quick-plants-occur.md b/.changeset/quick-plants-occur.md new file mode 100644 index 00000000..7ca91c8c --- /dev/null +++ b/.changeset/quick-plants-occur.md @@ -0,0 +1,5 @@ +--- +"@empiricalrun/scorer": patch +--- + +fix: python script scorer should prefer config.name diff --git a/packages/scorer/src/provider/deterministic/script.ts b/packages/scorer/src/provider/deterministic/script.ts index 728b7ebb..e3bdafaf 100644 --- a/packages/scorer/src/provider/deterministic/script.ts +++ b/packages/scorer/src/provider/deterministic/script.ts @@ -29,7 +29,7 @@ export const scoreWithPythonScript: ScoringFn = async ({ return [ { score: 0, - name, + name: config.name || name, message: "Python script path is not provided for running the scorer", }, ]; @@ -57,7 +57,7 @@ export const scoreWithPythonScript: ScoringFn = async ({ JSON.stringify([ { score: 0, - name, + name: config.name || name, message: "Scorer script timed out", }, ]), @@ -79,7 +79,7 @@ export const scoreWithPythonScript: ScoringFn = async ({ JSON.stringify([ { score: 0, - name, + name: config.name || name, message: `Scorer script error: ${message}`, }, ]),