-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
C# bindings need to be updated #2256
Comments
debugging into the C++ code the exception is at Viewing ctx in a watch window gives a cant read memory for the values. |
Looks like the csharp bindings in main are not in sync with the changes in the C code around prompt parameters. Pulling down the latest release version |
The C# binding has been removed as it has no maintainer. See #2429. |
Bug Report
Exception on Prompt callback
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Example Code
using Gpt4All;
var modelFactory = new Gpt4AllModelFactory();
if (args.Length < 2)
{
Console.WriteLine($"Usage: Gpt4All.Samples ");
return;
}
var modelPath = args[0];
var prompt = args[1];
using var model = modelFactory.LoadModel(modelPath);
var result = await model.GetStreamingPredictionAsync(
prompt,
PredictRequestOptions.Defaults);
//callback to prompt happens just after bolded code
await foreach (var token in result.GetPredictionStreamingAsync())
{
Console.Write(token);
}
Steps to Recreate
Exception thrown in LLModel.cs: NativeMethods.llmodel_prompt
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Repeat 2 times:
Expected Behavior:
The model response written to the console
Environment:
latest GPT4All from master, Model: gpt4all-13b-snoozy-q4_0.gguf, Windows 11, The current console Sample, Core 8, .NET 8
I saw others had this exception but during Model loads. Let me know what additional info might help or even some tip on debugging it. The handle passed into Prompt seems valid.
The text was updated successfully, but these errors were encountered: