fix: use fp32 models consistently everywhere to ensure compatibility

Changed default dtype from q8 to fp32 across all embedding implementations:
- embedding.ts: Default dtype changed to fp32
- worker-embedding.ts: Use fp32 for consistency
- universal-memory-manager.ts: Use fp32 for consistency
- lightweight-embedder.ts: Use fp32 for consistency
- hybridModelManager.ts: Use fp32 for all configurations

This ensures we use the exact same model (model.onnx) everywhere,
maintaining data compatibility and avoiding 404 errors for quantized models.
This commit is contained in:
David Snelling 2025-08-29 10:23:23 -07:00
parent d0f2e3e939
commit 32e39ded53
11 changed files with 11 additions and 30742 deletions

View file

@ -113,7 +113,7 @@ export class LightweightEmbedder {
console.log('⚠️ Loading ONNX model for complex text...')
const { TransformerEmbedding } = await import('../utils/embedding.js')
this.onnxEmbedder = new TransformerEmbedding({
dtype: 'q8',
dtype: 'fp32',
verbose: false
})
await this.onnxEmbedder.init()

View file

@ -139,7 +139,7 @@ export class UniversalMemoryManager {
this.embeddingFunction = new TransformerEmbedding({
verbose: false,
dtype: 'q8',
dtype: 'fp32',
localFilesOnly: process.env.BRAINY_ALLOW_REMOTE_MODELS !== 'true'
})

View file

@ -16,7 +16,7 @@ async function initModel(): Promise<void> {
if (!model) {
model = new TransformerEmbedding({
verbose: false,
dtype: 'q8',
dtype: 'fp32',
localFilesOnly: process.env.BRAINY_ALLOW_REMOTE_MODELS !== 'true'
})
await model.init()