Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2605d09

Browse files
committed
fix: remove dimension detection error for ollama
Signed-off-by: ChengZi <[email protected]>
1 parent ada7503 commit 2605d09

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

packages/core/src/embedding/ollama-embedding.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,11 @@ export class OllamaEmbedding extends Embedding {
9292
// Preprocess all texts
9393
const processedTexts = this.preprocessTexts(texts);
9494

95-
// Detect dimension on first use
95+
// Detect dimension on first use if not configured
9696
if (!this.dimensionDetected && !this.config.dimension) {
9797
this.dimension = await this.detectDimension();
9898
this.dimensionDetected = true;
9999
console.log(`📏 Detected Ollama embedding dimension: ${this.dimension} for model: ${this.config.model}`);
100-
} else {
101-
throw new Error('Failed to detect dimension for model ' + this.config.model);
102100
}
103101

104102
// Use Ollama's native batch embedding API

0 commit comments

Comments
 (0)