From d161a14b7c9335e6f2d9826c472bdf589c70ba71 Mon Sep 17 00:00:00 2001 From: Martin Evans Date: Wed, 14 Oct 2026 23:35:46 +0100 Subject: [PATCH 1/5] - Updated nuget packages - Updated all projects to dotnet 10 from dotnet 8.0 - Removed ImageSharp dependency --- LLama.Benchmark/LLama.Benchmark.csproj | 2 +- .../Examples/MtmdInteractiveModeExecute.cs | 25 ++++--------------- LLama.Examples/LLama.Examples.csproj | 16 ++++++------ LLama.Unittest/LLama.Unittest.csproj | 10 ++++---- LLama.Web/LLama.Web.csproj | 4 +-- LLama.WebAPI/LLama.WebAPI.csproj | 2 +- LLama/LLamaSharp.csproj | 18 ++++++------- 7 files changed, 30 insertions(+), 47 deletions(-) diff --git a/LLama.Benchmark/LLama.Benchmark.csproj b/LLama.Benchmark/LLama.Benchmark.csproj index 8d18e0251..17cbfbf20 100644 --- a/LLama.Benchmark/LLama.Benchmark.csproj +++ b/LLama.Benchmark/LLama.Benchmark.csproj @@ -3,7 +3,7 @@ Exe - net8.0 + net10.0 enable enable Release diff --git a/LLama.Examples/Examples/MtmdInteractiveModeExecute.cs b/LLama.Examples/Examples/MtmdInteractiveModeExecute.cs index 571a89c1a..b93e532f8 100644 --- a/LLama.Examples/Examples/MtmdInteractiveModeExecute.cs +++ b/LLama.Examples/Examples/MtmdInteractiveModeExecute.cs @@ -1,11 +1,7 @@ -using System.Collections.Generic; -using System.IO; using System.Text; using System.Text.RegularExpressions; -using LLama; using LLama.Common; using LLama.Exceptions; -using Spectre.Console; using LLama.Native; using LLama.Sampling; @@ -17,11 +13,11 @@ public class MtmdInteractiveModeExecute { public static async Task Run() { - string multiModalProj = UserSettings.GetMMProjPath(); - string modelPath = UserSettings.GetModelPath(); + var multiModalProj = UserSettings.GetMMProjPath(); + var modelPath = UserSettings.GetModelPath(); const int maxTokens = 4096; - string? prompt = await File.ReadAllTextAsync("Assets/chat-with-bob.json"); + var prompt = await File.ReadAllTextAsync("Assets/chat-with-bob.json"); var parameters = new ModelParams(modelPath); @@ -164,7 +160,7 @@ void ResetConversation() if (isImage) { // Keep the raw image data so the caller can reuse or inspect the images later. - imageList.Add(File.ReadAllBytes(mediaPath)); + imageList.Add(await File.ReadAllBytesAsync(mediaPath)); } else if (isAudio) { @@ -197,18 +193,7 @@ void ResetConversation() if (imageList.Count > 0) { Console.ForegroundColor = ConsoleColor.Yellow; - Console.WriteLine("Here are the images, that are sent to the chat model in addition to your message."); - Console.WriteLine(); - - foreach (var consoleImage in imageList.Select(image => new CanvasImage(image.ToArray()))) - { - consoleImage.MaxWidth = 50; - AnsiConsole.Write(consoleImage); - } - - Console.WriteLine(); - Console.ForegroundColor = ConsoleColor.Yellow; - Console.WriteLine("The images were scaled down for the console only, the model gets full versions."); + Console.WriteLine($"Loaded images files: {string.Join(", ", imageList)}"); Console.WriteLine(); } diff --git a/LLama.Examples/LLama.Examples.csproj b/LLama.Examples/LLama.Examples.csproj index bc3f3abec..32f55cb63 100644 --- a/LLama.Examples/LLama.Examples.csproj +++ b/LLama.Examples/LLama.Examples.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net10.0 enable enable AnyCPU;x64 @@ -14,15 +14,13 @@ - - - - - - - + + + + + - + diff --git a/LLama.Unittest/LLama.Unittest.csproj b/LLama.Unittest/LLama.Unittest.csproj index ae7c6d934..447d41387 100644 --- a/LLama.Unittest/LLama.Unittest.csproj +++ b/LLama.Unittest/LLama.Unittest.csproj @@ -1,7 +1,7 @@  - net8.0 + net10.0 LLama.Unittest enable AnyCPU;x64 @@ -13,10 +13,10 @@ - - + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -24,7 +24,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - +