MCPcopy Create free account
hub / github.com/aetherstate/GODMOD3.AI / parseBatchInfos

Function parseBatchInfos

api/lib/hf-reader.ts:152–171  ·  view source on GitHub ↗
(files: HFFileEntry[])

Source from the content-addressed store, hash-verified

150}
151
152function parseBatchInfos(files: HFFileEntry[]): BatchInfo[] {
153 return files
154 .filter(f => f.type === 'file' && f.path.endsWith('.jsonl'))
155 .map(f => {
156 const category = f.path.startsWith('metadata/') ? 'metadata' as const : 'dataset' as const
157 // Filename format: batch_<timestamp>_<seq>.jsonl
158 const match = f.path.match(/batch_(.+?)_(\d+)\.jsonl$/)
159 return {
160 path: f.path,
161 category,
162 size: f.size,
163 timestamp: match ? match[1].replace(/-/g, (m, offset: number) => {
164 // Restore ISO timestamp separators: first 2 dashes are date, then T, then colons, then dot
165 return m
166 }) : null,
167 sequence: match ? match[2] : null,
168 }
169 })
170 .sort((a, b) => (a.path > b.path ? -1 : 1)) // newest first
171}
172
173// ── Core: Read a Batch File ──────────────────────────────────────────
174

Callers 1

listBatchFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected