Skip to content

Commit

Permalink
Fix: tryAGI#343 - LlamaSharpEmbeddings: EmbeddingMode must be true ex…
Browse files Browse the repository at this point in the history
…ception fixed by passing the embeddingMode condiguration to the LlamaEmbedder
  • Loading branch information
OctavioUlla committed Jun 14, 2024
1 parent 6c84131 commit b9c62d2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Providers/LLamaSharp/src/LLamaSharpEmbeddings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using LLama.Common;
using LLama;
using LLama;
using LLama.Common;

namespace LangChain.Providers.LLamaSharp;

Expand All @@ -23,7 +23,8 @@ public static LLamaSharpEmbeddings FromPath(string path, float temperature = 0)
return new LLamaSharpEmbeddings(new LLamaSharpConfiguration
{
PathToModelFile = path,
Temperature = temperature
Temperature = temperature,
EmbeddingMode = true
});
}

Expand All @@ -43,6 +44,7 @@ public LLamaSharpEmbeddings(LLamaSharpConfiguration configuration) : base(id: "L
{
ContextSize = (uint)configuration.ContextSize,
Seed = (uint)configuration.Seed,
Embeddings = configuration.EmbeddingMode
};
_model = LLamaWeights.LoadFromFile(parameters);
_configuration = configuration;
Expand Down

0 comments on commit b9c62d2

Please sign in to comment.