Transformers.js documentation

backends/onnx

You are viewing main version, which requires installation from source. If you'd like regular npm install, checkout the latest stable version (v3.8.1).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

backends/onnx

Handler file for choosing the correct version of ONNX Runtime, based on the environment:

  • When running in node, we use onnxruntime-node (onnxruntime-web is not bundled).
  • When running in the browser, we use onnxruntime-web (onnxruntime-node is not bundled).

This module is not directly exported, but can be accessed through the environment variables:

import { env } from '@huggingface/transformers';
console.log(env.backends.onnx);

Type Definitions

ONNXExecutionProviders

Type: InferenceSession.ExecutionProviderConfig

Update on GitHub