mirror of
https://github.com/zilliztech/claude-context.git
synced 2025-10-06 01:10:02 +03:00
fix: remove dimension detection error for ollama
Signed-off-by: ChengZi <chen.zhang@zilliz.com>
This commit is contained in:
@@ -92,13 +92,11 @@ export class OllamaEmbedding extends Embedding {
|
||||
// Preprocess all texts
|
||||
const processedTexts = this.preprocessTexts(texts);
|
||||
|
||||
// Detect dimension on first use
|
||||
// Detect dimension on first use if not configured
|
||||
if (!this.dimensionDetected && !this.config.dimension) {
|
||||
this.dimension = await this.detectDimension();
|
||||
this.dimensionDetected = true;
|
||||
console.log(`📏 Detected Ollama embedding dimension: ${this.dimension} for model: ${this.config.model}`);
|
||||
} else {
|
||||
throw new Error('Failed to detect dimension for model ' + this.config.model);
|
||||
}
|
||||
|
||||
// Use Ollama's native batch embedding API
|
||||
|
||||
Reference in New Issue
Block a user