fix loss parser

This commit is contained in:
josc146 2023-07-09 11:32:05 +08:00
parent 5b1a9448e6
commit 22afc98be5

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+(\d+.\d+it\/s), loss=(\S+),[\s\S]*\]/g; const regex = /Epoch (\d+):\s+(\d+%)\|[\s\S]*\| (\d+)\/(\d+) \[(\d+:\d+)<(\d+:\d+),\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;