From f105e018c340febeda12d76f4304c50b856bb06e Mon Sep 17 00:00:00 2001 From: Octavio Ulla Date: Fri, 14 Jun 2024 17:31:02 -0300 Subject: [PATCH] fix: LlamaSharpEmbeddings: EmbeddingMode must be true exception fixed by passing the embeddingMode condiguration to the LlamaEmbedder (#344) --- src/Providers/LLamaSharp/src/LLamaSharpEmbeddings.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Providers/LLamaSharp/src/LLamaSharpEmbeddings.cs b/src/Providers/LLamaSharp/src/LLamaSharpEmbeddings.cs index 1a1e65fa..0cfc13f8 100644 --- a/src/Providers/LLamaSharp/src/LLamaSharpEmbeddings.cs +++ b/src/Providers/LLamaSharp/src/LLamaSharpEmbeddings.cs @@ -1,5 +1,5 @@ -using LLama.Common; -using LLama; +using LLama; +using LLama.Common; namespace LangChain.Providers.LLamaSharp; @@ -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 }); } @@ -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;