Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,20 @@ jobs:
apk add --no-cache git bash icu-libs libstdc++ libgomp
dotnet --list-runtimes
dotnet --list-sdks
- name: Install .NET 8.0 runtime (Alpine)
- name: Install .NET 10.0 runtime (Alpine)
if: ${{ matrix.build == 'linux-musl-x64-cpu' }}
run: |
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh --runtime dotnet --channel 8.0 --install-dir /usr/share/dotnet
./dotnet-install.sh --runtime dotnet --channel 10.0 --install-dir /usr/share/dotnet
rm dotnet-install.sh

- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v4
if: ${{ matrix.build != 'linux-musl-x64-cpu' }}
with:
dotnet-version: |
8.0.x
10.0.x
- name: Install Mobile Workloads
if: ${{ contains(runner.os, 'windows') }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion LLama.Benchmark/LLama.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Configuration>Release</Configuration>
Expand Down
2 changes: 1 addition & 1 deletion LLama.Examples/ExampleRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ExampleRunner
{ "Batched Executor: BoolQ Benchmark", BatchedExecutorBoolQ.Run },
{ "Batched Executor: Beam Search", BatchedExecutorBeamSearch.Run },
{ "Custom Sampling Pipeline", CustomSampler.Run },
{ "Speech Chat: Integration with Whisper.net", SpeechChat.Run },
//{ "Speech Chat: Integration with Whisper.net", SpeechChat.Run },
{ "Exit", () => { Environment.Exit(0); return Task.CompletedTask; } }
};

Expand Down
1 change: 0 additions & 1 deletion LLama.Examples/Examples/BatchedExecutorMtmd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public static async Task Run()
var promptText = string.Concat(marker, promptSuffix);

var imagePath = UserSettings.GetImagePath();
AnsiConsole.Write(new CanvasImage(imagePath));

var vocab = executor.Context.NativeHandle.ModelHandle.Vocab;

Expand Down
25 changes: 5 additions & 20 deletions LLama.Examples/Examples/MtmdInteractiveModeExecute.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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);

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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();
}

Expand Down
239 changes: 0 additions & 239 deletions LLama.Examples/Examples/SpeechChat.cs

This file was deleted.

14 changes: 3 additions & 11 deletions LLama.Examples/LLama.Examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\LLama\LLamaSharp.Runtime.targets" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net10.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Platforms>AnyCPU;x64</Platforms>
Expand All @@ -14,16 +14,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.5" />
<PackageReference Include="NAudio" Version="2.3.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
<PackageReference Include="Spectre.Console" Version="0.54.0" />
<PackageReference Include="Spectre.Console.ImageSharp" Version="0.54.0" />
<PackageReference Include="Whisper.net" Version="1.9.0" />
<PackageReference Include="Whisper.net.Runtime" Version="1.9.0" />
<PackageReference Include="Whisper.net.Runtime.Clblast" Version="1.5.0" />
<PackageReference Include="Whisper.net.Runtime.CoreML" Version="1.9.0" />
<PackageReference Include="Whisper.net.Runtime.Cublas" Version="1.5.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.13" />
<PackageReference Include="Spectre.Console" Version="0.57.2" />
<PackageReference Include="Microsoft.Agents.AI" Version="*-*" />
<PackageReference Include="Microsoft.Extensions.AI" Version="*-*" />
<PackageReference Include="CommunityToolkit.VectorData.SqliteVec" Version="*-*" />
Expand Down
6 changes: 4 additions & 2 deletions LLama.Unittest/AssemblyAttributes.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

using Xunit.Sdk;
using Xunit.v3;

// Disable running tests in parallel. Some tests load language models and try to and
// this can cause a lockup due to memory thrashing and terrible performance.
// e.g. 7GB model loaded by 10 different tests and trying to evaluate prompts
[assembly: CollectionBehavior(DisableTestParallelization = true)]
[assembly: Parallelization(Algorithm = ParallelAlgorithm.Conservative, MaxThreads = 1, Mode = ParallelMode.None)]
1 change: 0 additions & 1 deletion LLama.Unittest/BasicTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using LLama.Common;
using Xunit.Abstractions;

namespace LLama.Unittest
{
Expand Down
Loading
Loading