microsoft / Phi-3CookBook

This is a Phi-3 book for getting started with Phi-3. Phi-3, a family of open sourced AI models developed by Microsoft. Phi-3 models are the most capable and cost-effective small language models (SLMs) available, outperforming models of the same size and next size up across a variety of language, reasoning, coding, and math benchmarks.
MIT License
2.47k stars 251 forks source link

LabsPhi3_sk_rag01 fails #144

Closed Barshan-Mandal closed 1 day ago

Barshan-Mandal commented 3 months ago

System.MissingMethodException HResult=0x80131513 Message=Method not found: 'System.ValueTuple3<System.ReadOnlyMemory1<Int64>,System.ReadOnlyMemory1,System.ReadOnlyMemory1<Int64>> FastBertTokenizer.BertTokenizer.Encode(System.String, Int32, System.Nullable1)'. Source=SmartComponents.LocalEmbeddings StackTrace: at SmartComponents.LocalEmbeddings.LocalEmbedder.Embed[TEmbedding](String inputText, Nullable1 outputBuffer, Int32 maximumTokens) at SmartComponents.LocalEmbeddings.LocalEmbedder.Embed(String inputText, Int32 maximumTokens) at SmartComponents.LocalEmbeddings.SemanticKernel.LocalTextEmbeddingGenerationService.GenerateEmbeddingsAsync(IList1 data, Kernel kernel, CancellationToken cancellationToken) at Microsoft.SemanticKernel.Embeddings.EmbeddingGenerationExtensions.d0`2.MoveNext() at Microsoft.SemanticKernel.Memory.SemanticTextMemory.d3.MoveNext() at phi3vision_aiconsole.Program.d2.MoveNext() in O:\Windows For Programming\Projects\Visual Studio\Console\Ai\phi3vision_aiconsole\Program.cs:line 86 at phi3vision_aiconsole.Program.

d0.MoveNext() in O:\Windows For Programming\Projects\Visual Studio\Console\Ai\phi3vision_aiconsole\Program.cs:line 24 `

occurs at the following line

await memory.SaveInformationAsync(MemoryCollectionName, id: "info1", text: "Gisela's favourite super hero is Batman");

leestott commented 3 months ago

Hi @Barshan-Mandal are you taking the semantic Kernel samples from https://github.com/elbruno/phi3-labs by @elbruno?

If so please raise issues on that repo?

elbruno commented 2 months ago

Hi I'm working on update this sample to make it work again. In the meantime, you can refer to this post from Arafat, who performs a very similar scenario doing RAG in local mode.

https://arafattehsin.com/ai-copilot-offline-phi3-semantic-kernel/

Best

Barshan-Mandal commented 2 months ago

semantic text cant handle long books .try using kernel memory