VOOZH about

URL: https://www.nuget.org/packages/OnnxStack.Core/

⇱ NuGet Gallery | OnnxStack.Core 0.9.0




👁 Image
OnnxStack.Core 0.9.0

Prefix Reserved
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package OnnxStack.Core --version 0.9.0
 
 
NuGet\Install-Package OnnxStack.Core -Version 0.9.0
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OnnxStack.Core" Version="0.9.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OnnxStack.Core" Version="0.9.0" />
 
Directory.Packages.props
<PackageReference Include="OnnxStack.Core" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OnnxStack.Core --version 0.9.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OnnxStack.Core, 0.9.0"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OnnxStack.Core@0.9.0
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OnnxStack.Core&version=0.9.0
 
Install as a Cake Addin
#tool nuget:?package=OnnxStack.Core&version=0.9.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

OnnxStack.Core - Onnx Services for .NET Applications

OnnxStack.Core is a library that provides higher-level ONNX services for use in .NET applications. It offers extensive support for features such as dependency injection, .NET configuration implementations, ASP.NET Core integration, and IHostedService support.

You can configure a model set for runtime, offloading individual models to different devices to make better use of resources or run on lower-end hardware. The first use-case is StableDiffusion; however, it will be expanded, and other model sets, such as object detection and classification, will be added.

Getting Started

OnnxStack.Core can be found via the nuget package manager, download and install it.

PM> Install-Package OnnxStack.Core

.NET Core Registration

You can easily integrate OnnxStack.Core into your application services layer. This registration process sets up the necessary services and loads the appsettings.json configuration.

Example: Registering OnnxStack

builder.Services.AddOnnxStack();

Configuration example

The appsettings.json is the easiest option for configuring model sets. Below is an example of clip tokenizer.

{
	"Logging": {
		"LogLevel": {
			"Default": "Information",
			"Microsoft.AspNetCore": "Warning"
		}
	},
	"AllowedHosts": "*",

	"OnnxStackConfig": {
		"OnnxModelSets": [
			{
				"Name": "ClipTokenizer",
				"IsEnabled": true,
				"DeviceId": 0,
				"InterOpNumThreads": 0,
				"IntraOpNumThreads": 0,
				"ExecutionMode": "ORT_SEQUENTIAL",
				"ExecutionProvider": "DirectML",
				"ModelConfigurations": [
					{
						"Type": "Tokenizer",
						"OnnxModelPath": "cliptokenizer.onnx"
					},
				]
			}
		]
	}
}

Basic C# Example


// Tokenizer model Example
//----------------------//

// From DI
OnnxStackConfig _onnxStackConfig;
IOnnxModelService _onnxModelService;

// Get Model
var model = _onnxStackConfig.OnnxModelSets.First();

// Get Model Metadata
var metadata = _onnxModelService.GetModelMetadata(model, OnnxModelType.Tokenizer);

// Create Input
var text = "Text To Tokenize";
var inputTensor = new DenseTensor<string>(new string[] { text }, new int[] { 1 });

// Create Inference Parameters container
using (var inferenceParameters = new OnnxInferenceParameters(metadata))
{
	// Set Inputs and Outputs
	inferenceParameters.AddInputTensor(inputTensor);
	inferenceParameters.AddOutputBuffer();

	// Run Inference
	using (var results = _onnxModelService.RunInference(model, OnnxModelType.Tokenizer, inferenceParameters))
	{
		// Extract Result
		var resultData = results[0].ToDenseTensor();
	}
}

Product Versions Compatible and additional computed target framework versions.
.NET net7.0 net7.0 is compatible.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 was computed.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
Loading failed