diff --git a/LLama.Examples/LLama.Examples.csproj b/LLama.Examples/LLama.Examples.csproj index bbdd725c..426a649a 100644 --- a/LLama.Examples/LLama.Examples.csproj +++ b/LLama.Examples/LLama.Examples.csproj @@ -55,27 +55,15 @@ Never - - Never - Never - - Never - Never Never - - Never - - - Never - diff --git a/LLama.Unittest/LLama.Unittest.csproj b/LLama.Unittest/LLama.Unittest.csproj index b3c7db5e..22dae616 100644 --- a/LLama.Unittest/LLama.Unittest.csproj +++ b/LLama.Unittest/LLama.Unittest.csproj @@ -37,35 +37,20 @@ - + Never - + Never - + Never - - Never - - - Never - - - Never - - - Never - - + Never PreserveNewest - - PreserveNewest - diff --git a/LLama.WebAPI/LLama.WebAPI.csproj b/LLama.WebAPI/LLama.WebAPI.csproj index 2b14d8a4..09a1b253 100644 --- a/LLama.WebAPI/LLama.WebAPI.csproj +++ b/LLama.WebAPI/LLama.WebAPI.csproj @@ -22,4 +22,19 @@ Never + + + + Never + + + Never + + + Never + + + Never + + diff --git a/LLama/Native/NativeApi.cs b/LLama/Native/NativeApi.cs index c5c8d786..a0782b39 100644 --- a/LLama/Native/NativeApi.cs +++ b/LLama/Native/NativeApi.cs @@ -414,7 +414,7 @@ namespace LLama.Native /// size of the buffer /// The length writte, or if the buffer is too small a negative that indicates the length required [DllImport(libraryName, CallingConvention = CallingConvention.Cdecl)] - public static extern int llama_token_to_str_with_model(SafeLlamaModelHandle model, int llamaToken, byte* buffer, int length); + public static extern int llama_token_to_piece_with_model(SafeLlamaModelHandle model, int llamaToken, byte* buffer, int length); /// /// Convert text into tokens diff --git a/LLama/Native/SafeLlamaModelHandle.cs b/LLama/Native/SafeLlamaModelHandle.cs index 976d32e8..7074fddb 100644 --- a/LLama/Native/SafeLlamaModelHandle.cs +++ b/LLama/Native/SafeLlamaModelHandle.cs @@ -94,7 +94,7 @@ namespace LLama.Native { fixed (byte* destPtr = dest) { - var length = NativeApi.llama_token_to_str_with_model(this, llama_token, destPtr, dest.Length); + var length = NativeApi.llama_token_to_piece_with_model(this, llama_token, destPtr, dest.Length); return Math.Abs(length); } } @@ -110,7 +110,7 @@ namespace LLama.Native { unsafe { - var length = NativeApi.llama_token_to_str_with_model(this, llama_token, null, 0); + var length = NativeApi.llama_token_to_piece_with_model(this, llama_token, null, 0); if (length == 0) return ""; @@ -118,7 +118,7 @@ namespace LLama.Native fixed (byte* bytePtr = bytes) { - var written = NativeApi.llama_token_to_str_with_model(this, llama_token, bytePtr, bytes.Length); + var written = NativeApi.llama_token_to_piece_with_model(this, llama_token, bytePtr, bytes.Length); Debug.Assert(written == bytes.Length); return encoding.GetString(bytePtr, bytes.Length); @@ -136,7 +136,7 @@ namespace LLama.Native { unsafe { - var length = NativeApi.llama_token_to_str_with_model(this, llama_token, null, 0); + var length = NativeApi.llama_token_to_piece_with_model(this, llama_token, null, 0); if (length == 0) return; @@ -144,7 +144,7 @@ namespace LLama.Native fixed (byte* bytePtr = bytes) { // Decode into bytes - var written = NativeApi.llama_token_to_str_with_model(this, llama_token, bytePtr, bytes.Length); + var written = NativeApi.llama_token_to_piece_with_model(this, llama_token, bytePtr, bytes.Length); Debug.Assert(written == bytes.Length); // Decode into chars diff --git a/LLama/runtimes/libllama-cuda11.dll b/LLama/runtimes/libllama-cuda11.dll new file mode 100644 index 00000000..6ed31810 Binary files /dev/null and b/LLama/runtimes/libllama-cuda11.dll differ diff --git a/LLama/runtimes/libllama-cuda12.dll b/LLama/runtimes/libllama-cuda12.dll new file mode 100644 index 00000000..f1a9fbdc Binary files /dev/null and b/LLama/runtimes/libllama-cuda12.dll differ diff --git a/LLama/runtimes/libllama.dll b/LLama/runtimes/libllama.dll index 8432f664..a5f774f8 100644 Binary files a/LLama/runtimes/libllama.dll and b/LLama/runtimes/libllama.dll differ diff --git a/LLama/runtimes/libllama.dylib b/LLama/runtimes/libllama.dylib new file mode 100644 index 00000000..c385d2be Binary files /dev/null and b/LLama/runtimes/libllama.dylib differ diff --git a/LLama/runtimes/libllama.so b/LLama/runtimes/libllama.so new file mode 100644 index 00000000..e52d6bda Binary files /dev/null and b/LLama/runtimes/libllama.so differ