gpt4all
gpt4all copied to clipboard
C# Bindings fail to load models - Unit tests fail
System Info
- Windows 11 (10.0.22635)
- Visual Studio Enterprise 2022 (17.7.5)
- Vulkan SDK 1.3.261.1
- MSVC 19.37.32825 for x64
Information
- [X] The official example notebooks/scripts
- [ ] My own modified scripts
Reproduction
- Build the C# bindings with MSVC, and try to run the unit tests.
- Notice that at first they fail due to missing files.
- Grab all of the models from
https://raw.githubusercontent.com/nomic-ai/gpt4all/main/gpt4all-chat/metadata/models.json
- Notice that one of the models is still missing... 🤷♂️
- Notice that the other two Unit Tests fail due to the unmanaged code trying to access protected memory. 😭
Expected behavior
- The models should all be present (or the documentation should link to them).
- The unit tests should pass (without trying to corrupt protected memory!)
My progress on this: https://github.com/nomic-ai/gpt4all/tree/csharp-gguf Does it work for anyone besides me?
My progress on this: https://github.com/nomic-ai/gpt4all/tree/csharp-gguf Does it work for anyone besides me?
It works for me as well.
Initially, I encountered the same protected memory
error when building on the main branch.
After switching to your csharp-gguf
branch, I still faced some issues with the NativeMethods.llmodel_model_create2
method.
However, once I re-ran build_win-msvc.ps1
on your branch, the sample project started functioning correctly.
Thank you for your efforts! 😁
I can fully confirm, what @Vegolas said, I managed to create a local model runtime fully integrated into my software using the changes in the https://github.com/nomic-ai/gpt4all/tree/csharp-gguf branch.
Similar error is still exist in March 27th, 2024 version, fresh clone and C++ build.
Similar error is still exist in March 27th, 2024 version, fresh clone and C++ build.
Not the same issue. This means you are missing the required native libraries.