mirror of
https://github.com/garrytan/gstack.git
synced 2026-10-02 17:40:02 +02:00
fix(eval-pass-rates): match trial-outcome files by basename so Windows backslash paths are read
This commit is contained in:
1 parent
bfabda7419
commit
aba80c8fb6
1 file changed
+1
-1
@@ -155,7 +155,7 @@ export function readTrialOutcomeDir(dir: string): { records: TrialRecord[]; erro
|
|||||||
const errors: string[] = [];
|
const errors: string[] = [];
|
||||||
if (!fs.existsSync(dir)) return { records, errors };
|
if (!fs.existsSync(dir)) return { records, errors };
|
||||||
for (const name of fs.readdirSync(dir, { recursive: true }) as string[]) {
|
for (const name of fs.readdirSync(dir, { recursive: true }) as string[]) {
|
||||||
if (!/(^|\/)trial-outcomes[^/]*\.jsonl$/.test(name)) continue;
|
if (!/^trial-outcomes[^/\\]*\.jsonl$/.test(path.basename(name))) continue;
|
||||||
const full = path.join(dir, name);
|
const full = path.join(dir, name);
|
||||||
const parsed = parseTrialOutcomes(fs.readFileSync(full, 'utf8'), { maxBytes: TRIAL_OUTCOMES_MAX_BYTES });
|
const parsed = parseTrialOutcomes(fs.readFileSync(full, 'utf8'), { maxBytes: TRIAL_OUTCOMES_MAX_BYTES });
|
||||||
records.push(...parsed.records.map(record => ({
|
records.push(...parsed.records.map(record => ({
|
||||||
|
|||||||
Reference in new issue
Block a user