From cf2e9e35f8f77892fd0c21d1c339c6b8e4cea7d0 Mon Sep 17 00:00:00 2001 From: Steven Kennedy Date: Mon, 8 Jan 2024 16:35:55 +0000 Subject: [PATCH 1/2] Updating the GpuLayerCount to mirror the Python Port of Llama.cpp --- LLama/Extensions/IModelParamsExtensions.cs | 2 ++ LLama/LLamaSharp.csproj | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/LLama/Extensions/IModelParamsExtensions.cs b/LLama/Extensions/IModelParamsExtensions.cs index f3ef31f31..5883fb46d 100644 --- a/LLama/Extensions/IModelParamsExtensions.cs +++ b/LLama/Extensions/IModelParamsExtensions.cs @@ -25,6 +25,8 @@ public static IDisposable ToLlamaModelParams(this IModelParams @params, out LLam throw new NotSupportedException("'UseMemoryLock' is not supported (llama_mlock_supported() == false)"); if (@params.UseMemorymap && !NativeApi.llama_mmap_supported()) throw new NotSupportedException("'UseMemorymap' is not supported (llama_mmap_supported() == false)"); + if (@params.GpuLayerCount < 0) + @params.GpuLayerCount = int.MaxValue; var disposer = new GroupDisposable(); diff --git a/LLama/LLamaSharp.csproj b/LLama/LLamaSharp.csproj index 5e7de5f4d..c6ef58565 100644 --- a/LLama/LLamaSharp.csproj +++ b/LLama/LLamaSharp.csproj @@ -1,6 +1,6 @@ - netstandard2.0;net6.0;net7.0;net8.0 + netstandard2.0;net6.0;net7.0 LLama enable 10 From 988f2fa30262ae7a5ce4d83cf8d328e9ff112b50 Mon Sep 17 00:00:00 2001 From: Steven Kennedy Date: Mon, 8 Jan 2024 18:49:41 +0000 Subject: [PATCH 2/2] Reverted Net8.0 --- LLama/LLamaSharp.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LLama/LLamaSharp.csproj b/LLama/LLamaSharp.csproj index c6ef58565..5e7de5f4d 100644 --- a/LLama/LLamaSharp.csproj +++ b/LLama/LLamaSharp.csproj @@ -1,6 +1,6 @@ - netstandard2.0;net6.0;net7.0 + netstandard2.0;net6.0;net7.0;net8.0 LLama enable 10