From 222b94ed69158798c463d5fb374efbe44da199da Mon Sep 17 00:00:00 2001 From: Joshua Lochner Date: Wed, 7 Aug 2024 23:28:13 +0200 Subject: [PATCH] Do not set `preferredOutputLocation` if we are proxying session option "preferredOutputLocation" is not supported for proxy.' --- src/models.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models.js b/src/models.js index a2567374d..3e9c588b1 100644 --- a/src/models.js +++ b/src/models.js @@ -231,8 +231,8 @@ async function getSession(pretrained_model_name_or_path, fileName, options) { const shapes = getKeyValueShapes(options.config, { prefix: 'present', }); - if (Object.keys(shapes).length > 0) { - // Only set preferredOutputLocation if shapes are present + if (Object.keys(shapes).length > 0 && !isONNXProxy()) { + // Only set preferredOutputLocation if shapes are present and we aren't proxying ONNX const preferredOutputLocation = {}; for (const key in shapes) { preferredOutputLocation[key] = 'gpu-buffer';