Browse Source

Fix System.ArgumentException: EmbeddingMode must be true

tags/0.11.0
Kenneth Tang 1 year ago
parent
commit
3fda708eaa
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      LLama.KernelMemory/LLamaSharpTextEmbeddingGenerator.cs

+ 2
- 2
LLama.KernelMemory/LLamaSharpTextEmbeddingGenerator.cs View File

@@ -27,7 +27,7 @@ namespace LLamaSharp.KernelMemory
public LLamaSharpTextEmbeddingGenerator(LLamaSharpConfig config) public LLamaSharpTextEmbeddingGenerator(LLamaSharpConfig config)
{ {
this._config = config; this._config = config;
var @params = new ModelParams(_config.ModelPath);
var @params = new ModelParams(_config.ModelPath) { EmbeddingMode = true };
_weights = LLamaWeights.LoadFromFile(@params); _weights = LLamaWeights.LoadFromFile(@params);
_embedder = new LLamaEmbedder(_weights, @params); _embedder = new LLamaEmbedder(_weights, @params);
_ownsWeights = true; _ownsWeights = true;
@@ -42,7 +42,7 @@ namespace LLamaSharp.KernelMemory
public LLamaSharpTextEmbeddingGenerator(LLamaSharpConfig config, LLamaWeights weights) public LLamaSharpTextEmbeddingGenerator(LLamaSharpConfig config, LLamaWeights weights)
{ {
this._config = config; this._config = config;
var @params = new ModelParams(_config.ModelPath);
var @params = new ModelParams(_config.ModelPath) { EmbeddingMode = true };
_weights = weights; _weights = weights;
_embedder = new LLamaEmbedder(_weights, @params); _embedder = new LLamaEmbedder(_weights, @params);
_ownsEmbedder = true; _ownsEmbedder = true;


Loading…
Cancel
Save