You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use LLMSharpEmbeddings to use a SqlLite db to setup a RAG:
varmodelPath=@"D:\LLMModels\Models\thespis-13b-v0.5.Q2_K.gguf";//Also tested with Meta-Llama-3.1-8B-Instruct-Q6_KvarvectorDatabase=newSqLiteVectorDatabase(dataSource:@"D:\LLMModels\DBs\hp.db");varembeddingModel=LLamaSharpEmbeddings.FromPath(modelPath);varfileAddress=@"D:\LLMModels\RAGResources\Books\Harry-Potter-and-the-Philosophers-Stone.pdf";vardataSource=DataSource.FromPath(fileAddress);varvectorCollection=awaitvectorDatabase.AddDocumentsFromAsync<PdfPigPdfLoader>(embeddingModel,dimensions:5120,// Not sure about this param!dataSource:dataSource,collectionName:"harrypotter",textSplitter:null,behavior:AddDocumentsToDatabaseBehavior.OverwriteExistingCollection);conststringquestion="What is Harry's Address?";varsimilarDocuments=awaitvectorCollection.GetSimilarDocuments(embeddingModel,question,amount:5);Console.WriteLine($"Similar Doc Count: {similarDocuments.Count}");
the following exception is thrown: System.MissingMethodException HResult=0x80131513 Message=Method not found: '!!0 Microsoft.Extensions.AI.IEmbeddingGenerator2.GetService(System.Object)'.
Source=LangChain.Providers.LLamaSharp
StackTrace:
at LangChain.Providers.LLamaSharp.LLamaSharpEmbeddings..ctor(LLamaSharpConfiguration configuration)
`
I just went through this too. Commit [972e5ae] will fix it for 9.0.1-preview.1.24570.5 of Microsoft.Extensions.AI.Abstractions when it gets released. If you clone the repo, the examples work with latest code.
Could downgrade to v0.18.0 for now and should be good to go. The fun side to pre-release versions and interface breakage.
Description
What I want to achieve
I'm trying to use
LLMSharpEmbeddings
to use a SqlLite db to setup a RAG:However at this line:
the following exception is thrown:
System.MissingMethodException HResult=0x80131513 Message=Method not found: '!!0 Microsoft.Extensions.AI.IEmbeddingGenerator
2.GetService(System.Object)'.Source=LangChain.Providers.LLamaSharp
StackTrace:
at LangChain.Providers.LLamaSharp.LLamaSharpEmbeddings..ctor(LLamaSharpConfiguration configuration)
`
I also tried this:
Steps to reproduce the use the smple code
NuGet package version
<PackageReference Include="LangChain" Version="0.15.3-dev.14" /> <PackageReference Include="LangChain.Databases.Sqlite" Version="0.15.4-dev.48" /> <PackageReference Include="LangChain.DocumentLoaders.Pdf" Version="0.15.3-dev.14" /> <PackageReference Include="LangChain.Providers.Abstractions" Version="0.15.3-dev.93" /> <PackageReference Include="LangChain.Providers.HuggingFace" Version="0.15.3-dev.93" /> <PackageReference Include="LangChain.Providers.LLamaSharp" Version="0.15.3-dev.93" /> <PackageReference Include="LLamaSharp" Version="0.19.0" /> <PackageReference Include="LLamaSharp.Backend.Cuda12.Windows" Version="0.19.0" />
The text was updated successfully, but these errors were encountered: