fix loss parser

This commit is contained in:
josc146 2023-07-09 13:33:06 +08:00
parent 1689f9e7e7
commit fee8fe73f2

View File

@ -52,7 +52,7 @@ ChartJS.register(
); );
const parseLossData = (data: string) => { const parseLossData = (data: string) => {
const regex = /Epoch (\d+):\s+(\d+%)\|[\s\S]*\| (\d+)\/(\d+) \[(\d+:\d+)<(\d+:\d+),\s+([\S]*), loss=(\S+),[\s\S]*\]/g; const regex = /Epoch (\d+):\s+(\d+%)\|[\s\S]*\| (\d+)\/(\d+) \[(\S+)<(\S+),\s+(\S+), loss=(\S+),[\s\S]*\]/g;
const matches = Array.from(data.matchAll(regex)); const matches = Array.from(data.matchAll(regex));
if (matches.length === 0) if (matches.length === 0)
return false; return false;