Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Unhandled exception. System.Text.Json.JsonException: '0x00' is an invalid start of a value #1008

Open
biapar opened this issue Dec 2, 2024 · 0 comments

Comments

@biapar
Copy link

biapar commented Dec 2, 2024

Description

Error:

Error on JSON Read:
Unhandled exception. System.Text.Json.JsonException: '0x00' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.
---> System.Text.Json.JsonReaderException: '0x00' is an invalid start of a value. LineNumber: 0 | BytePositionInLine: 0.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan1 bytes) at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker) at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first) at System.Text.Json.Utf8JsonReader.ReadSingleSegment() at System.Text.Json.Utf8JsonReader.Read() at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state) at System.Text.Json.Serialization.Metadata.JsonTypeInfo1.Deserialize(Utf8JsonReader& reader, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 utf8Json, JsonTypeInfo1 jsonTypeInfo, Nullable1 actualByteCount) at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo1 jsonTypeInfo) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at Microsoft.KernelMemory.MemoryStorage.DevTools.SimpleVectorDb.GetListAsync(String index, ICollection1 filters, Int32 limit, Boolean withEmbeddings, CancellationToken cancellationToken)+MoveNext()
at Microsoft.KernelMemory.MemoryStorage.DevTools.SimpleVectorDb.GetListAsync(String index, ICollection1 filters, Int32 limit, Boolean withEmbeddings, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult() at Microsoft.KernelMemory.MemoryStorage.DevTools.SimpleVectorDb.GetSimilarListAsync(String index, String text, ICollection1 filters, Double minRelevance, Int32 limit, Boolean withEmbeddings, CancellationToken cancellationToken)+MoveNext()
at Microsoft.KernelMemory.MemoryStorage.DevTools.SimpleVectorDb.GetSimilarListAsync(String index, String text, ICollection1 filters, Double minRelevance, Int32 limit, Boolean withEmbeddings, CancellationToken cancellationToken)+MoveNext() at Microsoft.KernelMemory.MemoryStorage.DevTools.SimpleVectorDb.GetSimilarListAsync(String index, String text, ICollection1 filters, Double minRelevance, Int32 limit, Boolean withEmbeddings, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
at Microsoft.KernelMemory.Search.SearchClient.AskAsync(String index, String question, ICollection1 filters, Double minRelevance, IContext context, CancellationToken cancellationToken) at Microsoft.KernelMemory.Search.SearchClient.AskAsync(String index, String question, ICollection1 filters, Double minRelevance, IContext context, CancellationToken cancellationToken)
at Program.ShowAnswer(IKernelMemory memory, String question) in /Users/biagioparuolo/ProjectsOnMac/_BWare360Projects/LLMSharp/LLMSharpDemo/LLMSharpDemo/Program.cs:line 145
at Program.StartUserChatSession(IKernelMemory memory) in /Users/biagioparuolo/ProjectsOnMac/_BWare360Projects/LLMSharp/LLMSharpDemo/LLMSharpDemo/Program.cs:line 251
at Program.Main(String[] args) in /Users/biagioparuolo/ProjectsOnMac/_BWare360Projects/LLMSharp/LLMSharpDemo/LLMSharpDemo/Program.cs:line 132
at Program.

Reproduction Steps

I use LLAMASharp + KernelMemory with PDF analysis. I try with a long PDF. When I query the model, I've this error.
I import the docs with:

await memory.ImportDocumentAsync(documentPaths[I],
                    steps: Constants.PipelineWithoutSummary);


  SimpleFileStorageConfig storageConfig = new()
                                                {
                                                    Directory = StorageFolder,
                                                    StorageType = FileSystemTypes.Disk,
                                                };

        
        SimpleVectorDbConfig vectorDbConfig = new()
                                              {
                                                  Directory = StorageFolder,
                                                  StorageType = FileSystemTypes.Disk,
                                              };

After I query the model, I've the crash.

Environment & Configuration

  • Operating system:
  • .NET runtime version:
  • LLamaSharp version:
  • CUDA version (if you are using cuda backend):
  • CPU & GPU device:

Known Workarounds

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant