Lokad.Onnx
0.1.4
Prefix Reserved
dotnet add package Lokad.Onnx --version 0.1.4
NuGet\Install-Package Lokad.Onnx -Version 0.1.4
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="Lokad.Onnx" Version="0.1.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Lokad.Onnx --version 0.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Lokad.Onnx, 0.1.4"
#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.
// Install Lokad.Onnx as a Cake Addin #addin nuget:?package=Lokad.Onnx&version=0.1.4 // Install Lokad.Onnx as a Cake Tool #tool nuget:?package=Lokad.Onnx&version=0.1.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Lokad.Onnx
About
Lokad.Onnx is a 100% managed code ONNX backend implementation.
Getting started
- Clone the repo and submodules:
git clone https://github.com/Lokad/Onnx.git --recurse-submodules
. - Run
build.cmd
from the repo root directory - Run
lonnx --help
to show the available CLI commands. The basic command syntax for running an ONNX model is:lonnx run (modelpathorurl) (input) --<options>
e.glonnx run .\tests\Lokad.Onnx.Backend.Tests\models\mnist-8.onnx .\tests\Lokad.Onnx.Backend.Tests\images\mnist4.png::mnist --softmax
will run the MNIST model at the path indicated using the image file indicated as input converted to the MNIST tensor shape 1x1x28x28. For language models you can saylonnx run https://huggingface.co/intfloat/multilingual-e5-small/resolve/main/onnx/model.onnx?download=true --text "me5s" "Hello world this is some text" --op-times 200 --print-input
To download and run the language model from the URL indicated using the text input converted to input tensors 1x[tokennum] using the multilingual-e5-small tokenizer, printing op times and the model input. - See the unit tests for example on how to use the library in your own .NET apps.
- The modules for using the backend from Python are here and can be imported into Python apps in the usual way.
Implementation notes
- The tensors library is pure managed C# adapted from here.
- Current NuGet dependencies for the Backend library are:
- System.Memory
- OnnxSharp - For parsing ONNX ProtoBuf model files and getting the computational graph structure
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.4)
- OnnxSharp (>= 0.2.1)
- System.Memory (>= 4.5.5)
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 |
---|---|---|
0.1.4 | 105 | 12/6/2024 |