Skip to content

Commit

Permalink
fix: LlamaSharpEmbeddings: EmbeddingMode must be true exception fixed…
Browse files Browse the repository at this point in the history
… by passing the embeddingMode condiguration to the LlamaEmbedder (#344)
  • Loading branch information
OctavioUlla authored Jun 14, 2024
1 parent 6c84131 commit f105e01
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 f105e01

Please sign in to comment.