{"record":{"id":"2ccb35d0ed7d24ef","repo":"diegosouzapw/OmniRoute","slug":"no-float32-tensor-found-in-safetensors-file","errorCode":null,"errorMessage":"No float32 tensor found in safetensors file","messagePattern":"No float32 tensor found in safetensors file","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/memory/embedding/staticPotion.ts","lineNumber":95,"sourceCode":"  for (const [key, meta] of Object.entries(header)) {\n    if (key === \"__metadata__\") continue;\n    if (!meta.dtype || !meta.shape || !meta.data_offsets) continue;\n    const dtype = meta.dtype.toLowerCase();\n    if (dtype !== \"f32\" && dtype !== \"float32\") continue;\n\n    const [startOffset, endOffset] = meta.data_offsets;\n    const dataStart = 8 + headerLen + startOffset;\n    const dataEnd = 8 + headerLen + endOffset;\n    const dataSlice = buf.slice(dataStart, dataEnd);\n\n    const floatCount = (dataEnd - dataStart) / 4;\n    const arr = new Float32Array(floatCount);\n    for (let i = 0; i < floatCount; i++) {\n      arr[i] = dataSlice.readFloatLE(i * 4);\n    }\n    return { matrix: arr, shape: meta.shape };\n  }\n  throw new Error(\"No float32 tensor found in safetensors file\");\n}\n\nasync function loadModel(): Promise<PotionModel> {\n  const modelDir = getModelDir();\n  await fs.mkdir(modelDir, { recursive: true });\n\n  const hfBase = `${HF_BASE}/${MODEL_ID}/resolve/main`;\n\n  const vocabPath = path.join(modelDir, \"vocab.json\");\n  const modelPath = path.join(modelDir, \"model.safetensors\");\n  const tokenizerPath = path.join(modelDir, \"tokenizer.json\");\n\n  await Promise.all([\n    ensureFile(vocabPath, `${hfBase}/vocab.json`),\n    ensureFile(modelPath, `${hfBase}/model.safetensors`),\n    ensureFile(tokenizerPath, `${hfBase}/tokenizer.json`),\n  ]);\n","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/memory/embedding/staticPotion.ts#L77-L113","documentation":"Error \"No float32 tensor found in safetensors file\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/memory/embedding/staticPotion.ts:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}