LLamaSharp
                                
                                 LLamaSharp copied to clipboard
                                
                                    LLamaSharp copied to clipboard
                            
                            
                            
                        If llama.dll is built in Debug mode, gibberish is produced when called from LLamaSharp
I tried to build my own libllama.dll (at 6b73ef120114beb5664ea94aab48d07ed248ee52, since that's what the committed libllama.dll is built from)
cmake --build . --target llama --config Debug
copy "C:\Source\llama.cpp\build\bin\Debug\llama.dll" "C:\Source\LLamaSharp\LLama.Examples\bin\Debug\net7.0\libllama.dll"
However, it appears to produce gibberish. On the other hand, it works correctly if I compile as Release.
At first I thought this was a llama.cpp issue, but the C++ binary main.exe works fine both in Debug and in Release mode.
Note: The reason I'm trying to use the Debug build it to more easily debug an unrelated problem.
That's very odd! I've just had a look through llama.cpp and I can't see any behaviour that should be different between release/debug.
The only thing I can suggest at the moment is tracing some of the low level calls and seeing if you can spot a difference in the parameters being passed or the values being returned.