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
4 changes: 2 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
whisper-model-

- name: Restore dependencies
run: dotnet restore OpenVINO.NET.sln
run: dotnet restore Fluid.OpenVINO.sln

- name: Download OpenVINO Runtime (Windows)
if: matrix.os == 'windows-latest'
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
shell: bash

- name: Build solution
run: dotnet build OpenVINO.NET.sln --configuration Release --no-restore
run: dotnet build Fluid.OpenVINO.sln --configuration Release --no-restore

- name: Set LD_LIBRARY_PATH for Linux
if: matrix.os == 'ubuntu-latest'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/llm-sample-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
model-${{ inputs.model_name || 'FluidInference/qwen3-0.6b-int4-ov-npu' }}-

- name: Restore dependencies
run: dotnet restore OpenVINO.NET.sln
run: dotnet restore Fluid.OpenVINO.sln

- name: Cache OpenVINO Runtime
id: cache-openvino-windows
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
}

- name: Build solution
run: dotnet build OpenVINO.NET.sln --configuration Release
run: dotnet build Fluid.OpenVINO.sln --configuration Release

- name: Download Benchmark Model
working-directory: ./samples/QuickDemo
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ jobs:
}

- name: Restore dependencies
run: dotnet restore OpenVINO.NET.sln
run: dotnet restore Fluid.OpenVINO.sln

- name: Build solution
shell: pwsh
run: |
Write-Host "Building with OPENVINO_RUNTIME_PATH: $env:OPENVINO_RUNTIME_PATH"
dotnet build OpenVINO.NET.sln --configuration Release --no-restore /p:TreatWarningsAsErrors=true
dotnet build Fluid.OpenVINO.sln --configuration Release --no-restore /p:TreatWarningsAsErrors=true
env:
CI: true

Expand Down Expand Up @@ -169,11 +169,11 @@ jobs:
dotnet-version: 9.0.x

- name: Restore dependencies
run: dotnet restore OpenVINO.NET.sln
run: dotnet restore Fluid.OpenVINO.sln

- name: Check formatting
run: dotnet format OpenVINO.NET.sln --verify-no-changes --verbosity diagnostic
run: dotnet format Fluid.OpenVINO.sln --verify-no-changes --verbosity diagnostic

- name: Run code analysis
run: |
dotnet build OpenVINO.NET.sln --configuration Release /p:EnableNETAnalyzers=true /p:AnalysisMode=AllEnabledByDefault
dotnet build Fluid.OpenVINO.sln --configuration Release /p:EnableNETAnalyzers=true /p:AnalysisMode=AllEnabledByDefault
4 changes: 2 additions & 2 deletions .github/workflows/whisper-sample-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
# Audio file is now included in the repository

- name: Restore dependencies
run: dotnet restore OpenVINO.NET.sln
run: dotnet restore Fluid.OpenVINO.sln

- name: Cache OpenVINO Runtime
id: cache-openvino-windows
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
}

- name: Build solution
run: dotnet build OpenVINO.NET.sln --configuration Release
run: dotnet build Fluid.OpenVINO.sln --configuration Release

- name: Test Model and OpenVINO Info
shell: pwsh
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions samples/QuickDemo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text.Json;
using OpenVINO.NET.GenAI;
using Fluid.OpenVINO.GenAI;

namespace QuickDemo;

Expand Down Expand Up @@ -88,7 +88,7 @@ static async Task RunDemoAsync(string device, bool benchmark, bool memoryMonitor
Console.WriteLine("=== OpenVINO GenAI Diagnostic Information ===");
try
{
var diagnosticInfo = OpenVINO.NET.GenAI.DiagnosticInfo.GetNativeLibraryDiagnostics();
var diagnosticInfo = Fluid.OpenVINO.GenAI.DiagnosticInfo.GetNativeLibraryDiagnostics();
Console.WriteLine(diagnosticInfo);
}
catch (Exception diagnosticEx)
Expand Down Expand Up @@ -331,9 +331,9 @@ static async Task RunSingleDeviceDemoAsync(string modelPath, string device, bool
// Always show summary table
if (overallMetrics != null)
{
PrintSummaryTable(overallMetrics);

// Only save metrics file when memory monitoring is enabled
PrintSummaryTable(overallMetrics);
// Only save metrics file when memory monitoring is enabled
if (memoryMonitoring)
{
await SavePerformanceMetricsAsync(overallMetrics);
Expand Down
2 changes: 1 addition & 1 deletion samples/StreamingChat/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OpenVINO.NET.GenAI;
using Fluid.OpenVINO.GenAI;

namespace StreamingChat.Sample;

Expand Down
2 changes: 1 addition & 1 deletion samples/TextGeneration/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OpenVINO.NET.GenAI;
using Fluid.OpenVINO.GenAI;

namespace TextGeneration.Sample;

Expand Down
2 changes: 1 addition & 1 deletion samples/WhisperDemo/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OpenVINO.NET.GenAI;
using Fluid.OpenVINO.GenAI;

namespace WhisperDemo;

Expand Down
8 changes: 4 additions & 4 deletions src/OpenVINO.NET.GenAI/AudioUtils.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenVINO.NET.GenAI;
namespace Fluid.OpenVINO.GenAI;

/// <summary>
/// Utility class for audio processing
Expand Down Expand Up @@ -72,9 +72,9 @@ public static float[] NormalizeAudio(float[] floatData)
if (floatData == null)
throw new ArgumentNullException(nameof(floatData));

var normalized = new float[floatData.Length];

// Find max absolute value
var normalized = new float[floatData.Length];
// Find max absolute value
float maxAbs = 0;
for (int i = 0; i < floatData.Length; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion src/OpenVINO.NET.GenAI/ChatSession.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenVINO.NET.GenAI;
namespace Fluid.OpenVINO.GenAI;

/// <summary>
/// Represents a chat session with automatic resource management
Expand Down
4 changes: 2 additions & 2 deletions src/OpenVINO.NET.GenAI/DiagnosticInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using OpenVINO.NET.GenAI.Native;
using Fluid.OpenVINO.GenAI.Native;

namespace OpenVINO.NET.GenAI;
namespace Fluid.OpenVINO.GenAI;

/// <summary>
/// Provides diagnostic information about OpenVINO GenAI library loading
Expand Down
4 changes: 2 additions & 2 deletions src/OpenVINO.NET.GenAI/Exceptions/OpenVINOGenAIException.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using OpenVINO.NET.GenAI.Native;
using Fluid.OpenVINO.GenAI.Native;

namespace OpenVINO.NET.GenAI.Exceptions;
namespace Fluid.OpenVINO.GenAI.Exceptions;

/// <summary>
/// Exception thrown by OpenVINO GenAI operations
/// </summary>
public class OpenVINOGenAIException : Exception

Check warning on line 8 in src/OpenVINO.NET.GenAI/Exceptions/OpenVINOGenAIException.cs

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Add the following constructor to OpenVINOGenAIException: public OpenVINOGenAIException(string message, Exception innerException) (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1032)

Check warning on line 8 in src/OpenVINO.NET.GenAI/Exceptions/OpenVINOGenAIException.cs

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Add the following constructor to OpenVINOGenAIException: public OpenVINOGenAIException(string message) (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1032)

Check warning on line 8 in src/OpenVINO.NET.GenAI/Exceptions/OpenVINOGenAIException.cs

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Add the following constructor to OpenVINOGenAIException: public OpenVINOGenAIException() (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1032)
{
/// <summary>
/// Gets the OpenVINO error code
Expand Down
8 changes: 4 additions & 4 deletions src/OpenVINO.NET.GenAI/GenerationConfig.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using OpenVINO.NET.GenAI.Exceptions;
using OpenVINO.NET.GenAI.Native;
using OpenVINO.NET.GenAI.SafeHandles;
using Fluid.OpenVINO.GenAI.Exceptions;
using Fluid.OpenVINO.GenAI.Native;
using Fluid.OpenVINO.GenAI.SafeHandles;

namespace OpenVINO.NET.GenAI;
namespace Fluid.OpenVINO.GenAI;

/// <summary>
/// Configuration for text generation parameters
Expand Down
8 changes: 4 additions & 4 deletions src/OpenVINO.NET.GenAI/GenerationResult.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Runtime.InteropServices;
using OpenVINO.NET.GenAI.Exceptions;
using OpenVINO.NET.GenAI.Native;
using OpenVINO.NET.GenAI.SafeHandles;
using Fluid.OpenVINO.GenAI.Exceptions;
using Fluid.OpenVINO.GenAI.Native;
using Fluid.OpenVINO.GenAI.SafeHandles;

namespace OpenVINO.NET.GenAI;
namespace Fluid.OpenVINO.GenAI;

/// <summary>
/// Result of text generation
Expand Down
8 changes: 4 additions & 4 deletions src/OpenVINO.NET.GenAI/LLMPipeline.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Runtime.CompilerServices;
using System.Threading.Channels;
using OpenVINO.NET.GenAI.Exceptions;
using OpenVINO.NET.GenAI.Native;
using OpenVINO.NET.GenAI.SafeHandles;
using Fluid.OpenVINO.GenAI.Exceptions;
using Fluid.OpenVINO.GenAI.Native;
using Fluid.OpenVINO.GenAI.SafeHandles;

namespace OpenVINO.NET.GenAI;
namespace Fluid.OpenVINO.GenAI;

/// <summary>
/// Large Language Model pipeline for text generation
Expand Down
2 changes: 1 addition & 1 deletion src/OpenVINO.NET.GenAI/Native/GenAINativeMethods.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Runtime.InteropServices;

namespace OpenVINO.NET.GenAI.Native;
namespace Fluid.OpenVINO.GenAI.Native;

/// <summary>
/// P/Invoke declarations for OpenVINO GenAI C API
Expand Down
2 changes: 1 addition & 1 deletion src/OpenVINO.NET.GenAI/Native/NativeLibraryLoader.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Reflection;
using System.Runtime.InteropServices;

namespace OpenVINO.NET.GenAI.Native;
namespace Fluid.OpenVINO.GenAI.Native;

/// <summary>
/// Handles platform-specific native library loading
Expand Down
2 changes: 1 addition & 1 deletion src/OpenVINO.NET.GenAI/Native/NativeStructures.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using System.Runtime.InteropServices;

namespace OpenVINO.NET.GenAI.Native;
namespace Fluid.OpenVINO.GenAI.Native;

/// <summary>
/// OpenVINO status codes enumeration
/// </summary>
public enum ov_status_e

Check warning on line 8 in src/OpenVINO.NET.GenAI/Native/NativeStructures.cs

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Remove the underscores from type name Fluid.OpenVINO.GenAI.Native.ov_status_e (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1707)
{
OK = 0,
GENERAL_ERROR = -1,

Check warning on line 11 in src/OpenVINO.NET.GenAI/Native/NativeStructures.cs

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Remove the underscores from member name Fluid.OpenVINO.GenAI.Native.ov_status_e.GENERAL_ERROR (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1707)
NOT_IMPLEMENTED = -2,

Check warning on line 12 in src/OpenVINO.NET.GenAI/Native/NativeStructures.cs

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Remove the underscores from member name Fluid.OpenVINO.GenAI.Native.ov_status_e.NOT_IMPLEMENTED (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1707)
NETWORK_NOT_LOADED = -3,

Check warning on line 13 in src/OpenVINO.NET.GenAI/Native/NativeStructures.cs

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Remove the underscores from member name Fluid.OpenVINO.GenAI.Native.ov_status_e.NETWORK_NOT_LOADED (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1707)
PARAMETER_MISMATCH = -4,

Check warning on line 14 in src/OpenVINO.NET.GenAI/Native/NativeStructures.cs

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Remove the underscores from member name Fluid.OpenVINO.GenAI.Native.ov_status_e.PARAMETER_MISMATCH (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1707)
NOT_FOUND = -5,

Check warning on line 15 in src/OpenVINO.NET.GenAI/Native/NativeStructures.cs

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Remove the underscores from member name Fluid.OpenVINO.GenAI.Native.ov_status_e.NOT_FOUND (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1707)
OUT_OF_BOUNDS = -6,

Check warning on line 16 in src/OpenVINO.NET.GenAI/Native/NativeStructures.cs

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Remove the underscores from member name Fluid.OpenVINO.GenAI.Native.ov_status_e.OUT_OF_BOUNDS (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1707)
UNEXPECTED = -7,
REQUEST_BUSY = -8,
RESULT_NOT_READY = -9,
Expand Down
8 changes: 4 additions & 4 deletions src/OpenVINO.NET.GenAI/PerformanceMetrics.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using OpenVINO.NET.GenAI.Exceptions;
using OpenVINO.NET.GenAI.Native;
using OpenVINO.NET.GenAI.SafeHandles;
using Fluid.OpenVINO.GenAI.Exceptions;
using Fluid.OpenVINO.GenAI.Native;
using Fluid.OpenVINO.GenAI.SafeHandles;

namespace OpenVINO.NET.GenAI;
namespace Fluid.OpenVINO.GenAI;

/// <summary>
/// Performance metrics for text generation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using OpenVINO.NET.GenAI.Native;
using Fluid.OpenVINO.GenAI.Native;

namespace OpenVINO.NET.GenAI.SafeHandles;
namespace Fluid.OpenVINO.GenAI.SafeHandles;

/// <summary>
/// Safe handle for Decoded Results native resources
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using OpenVINO.NET.GenAI.Native;
using Fluid.OpenVINO.GenAI.Native;

namespace OpenVINO.NET.GenAI.SafeHandles;
namespace Fluid.OpenVINO.GenAI.SafeHandles;

/// <summary>
/// Safe handle for Generation Config native resources
Expand Down
4 changes: 2 additions & 2 deletions src/OpenVINO.NET.GenAI/SafeHandles/LLMPipelineSafeHandle.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using OpenVINO.NET.GenAI.Native;
using Fluid.OpenVINO.GenAI.Native;

namespace OpenVINO.NET.GenAI.SafeHandles;
namespace Fluid.OpenVINO.GenAI.SafeHandles;

/// <summary>
/// Safe handle for LLM Pipeline native resources
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using OpenVINO.NET.GenAI.Native;
using Fluid.OpenVINO.GenAI.Native;

namespace OpenVINO.NET.GenAI.SafeHandles;
namespace Fluid.OpenVINO.GenAI.SafeHandles;

/// <summary>
/// Safe handle for Performance Metrics native resources
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using OpenVINO.NET.GenAI.Native;
using Fluid.OpenVINO.GenAI.Native;

namespace OpenVINO.NET.GenAI.SafeHandles;
namespace Fluid.OpenVINO.GenAI.SafeHandles;

/// <summary>
/// Safe handle for Whisper Decoded Result Chunk native resources
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using OpenVINO.NET.GenAI.Native;
using Fluid.OpenVINO.GenAI.Native;

namespace OpenVINO.NET.GenAI.SafeHandles;
namespace Fluid.OpenVINO.GenAI.SafeHandles;

/// <summary>
/// Safe handle for Whisper Decoded Results native resources
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using OpenVINO.NET.GenAI.Native;
using Fluid.OpenVINO.GenAI.Native;

namespace OpenVINO.NET.GenAI.SafeHandles;
namespace Fluid.OpenVINO.GenAI.SafeHandles;

/// <summary>
/// Safe handle for Whisper Generation Config native resources
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using OpenVINO.NET.GenAI.Native;
using Fluid.OpenVINO.GenAI.Native;

namespace OpenVINO.NET.GenAI.SafeHandles;
namespace Fluid.OpenVINO.GenAI.SafeHandles;

/// <summary>
/// Safe handle for Whisper Pipeline native resources
Expand Down
2 changes: 1 addition & 1 deletion src/OpenVINO.NET.GenAI/WhisperDecodedResult.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OpenVINO.NET.GenAI;
namespace Fluid.OpenVINO.GenAI;

/// <summary>
/// Represents a decoded result from Whisper speech recognition
Expand Down
24 changes: 12 additions & 12 deletions src/OpenVINO.NET.GenAI/WhisperGenerationConfig.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using OpenVINO.NET.GenAI.Exceptions;
using OpenVINO.NET.GenAI.Native;
using OpenVINO.NET.GenAI.SafeHandles;
using Fluid.OpenVINO.GenAI.Exceptions;
using Fluid.OpenVINO.GenAI.Native;
using Fluid.OpenVINO.GenAI.SafeHandles;

namespace OpenVINO.NET.GenAI;
namespace Fluid.OpenVINO.GenAI;

/// <summary>
/// Configuration for Whisper speech recognition parameters
Expand Down Expand Up @@ -85,8 +85,8 @@ public WhisperGenerationConfig WithLanguage(string language)
public WhisperGenerationConfig WithTask(WhisperTask task)
{
ThrowIfDisposed();
var taskString = task == WhisperTask.Transcribe ? "transcribe" : "translate";

var taskString = task == WhisperTask.Transcribe ? "transcribe" : "translate";
var status = GenAINativeMethods.ov_genai_whisper_generation_config_set_task(_handle.DangerousGetHandle(), taskString);
OpenVINOGenAIException.ThrowIfError(status, "set task");
return this;
Expand All @@ -99,8 +99,8 @@ public WhisperGenerationConfig WithTask(WhisperTask task)
/// <returns>This configuration instance for fluent chaining</returns>
public WhisperGenerationConfig WithTimestamps(bool returnTimestamps = true)
{
ThrowIfDisposed();

ThrowIfDisposed();
var status = GenAINativeMethods.ov_genai_whisper_generation_config_set_return_timestamps(_handle.DangerousGetHandle(), returnTimestamps);
OpenVINOGenAIException.ThrowIfError(status, "set return timestamps");
return this;
Expand Down Expand Up @@ -143,8 +143,8 @@ public WhisperGenerationConfig WithHotwords(string hotwords)
/// </summary>
public void Validate()
{
ThrowIfDisposed();

ThrowIfDisposed();
var status = GenAINativeMethods.ov_genai_whisper_generation_config_validate(_handle.DangerousGetHandle());
OpenVINOGenAIException.ThrowIfError(status, "validate whisper generation config");
}
Expand Down Expand Up @@ -176,8 +176,8 @@ public enum WhisperTask
/// <summary>
/// Transcribe audio in the original language
/// </summary>
Transcribe,

Transcribe,
/// <summary>
/// Translate audio to English
/// </summary>
Expand Down
Loading
Loading