@huggingface/inference
Advanced tools
Comparing version 2.5.1 to 2.5.2
@@ -561,5 +561,5 @@ /// <reference path="./index.d.ts" /> | ||
}; | ||
isValidOutput = Array.isArray(res) && isNumArrayRec(res, 2, 0); | ||
isValidOutput = Array.isArray(res) && isNumArrayRec(res, 3, 0); | ||
if (!isValidOutput) { | ||
throw new InferenceOutputError("Expected Array<number[][] | number[] | number>"); | ||
throw new InferenceOutputError("Expected Array<number[][][] | number[][] | number[] | number>"); | ||
} | ||
@@ -566,0 +566,0 @@ return res; |
@@ -512,3 +512,3 @@ export interface Options { | ||
/** | ||
* Returned values are a list of floats, or a list of list of floats, or a list of list of list of floats (depending on if you sent a string or a list of string, and if the automatic reduction, usually mean_pooling for instance was applied for you or not. This should be explained on the model's README. | ||
* Returned values are a multidimensional array of floats (dimension depending on if you sent a string or a list of string, and if the automatic reduction, usually mean_pooling for instance was applied for you or not. This should be explained on the model's README). | ||
*/ | ||
@@ -515,0 +515,0 @@ export type FeatureExtractionOutput = (number | number[] | number[][])[]; |
@@ -561,5 +561,5 @@ /// <reference path="./index.d.ts" /> | ||
}; | ||
isValidOutput = Array.isArray(res) && isNumArrayRec(res, 2, 0); | ||
isValidOutput = Array.isArray(res) && isNumArrayRec(res, 3, 0); | ||
if (!isValidOutput) { | ||
throw new InferenceOutputError("Expected Array<number[][] | number[] | number>"); | ||
throw new InferenceOutputError("Expected Array<number[][][] | number[][] | number[] | number>"); | ||
} | ||
@@ -566,0 +566,0 @@ return res; |
{ | ||
"name": "@huggingface/inference", | ||
"version": "2.5.1", | ||
"version": "2.5.2", | ||
"packageManager": "pnpm@8.3.1", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -17,3 +17,3 @@ import { InferenceOutputError } from "../../lib/InferenceOutputError"; | ||
/** | ||
* Returned values are a list of floats, or a list of list of floats, or a list of list of list of floats (depending on if you sent a string or a list of string, and if the automatic reduction, usually mean_pooling for instance was applied for you or not. This should be explained on the model's README. | ||
* Returned values are a multidimensional array of floats (dimension depending on if you sent a string or a list of string, and if the automatic reduction, usually mean_pooling for instance was applied for you or not. This should be explained on the model's README). | ||
*/ | ||
@@ -50,8 +50,8 @@ export type FeatureExtractionOutput = (number | number[] | number[][])[]; | ||
isValidOutput = Array.isArray(res) && isNumArrayRec(res, 2, 0); | ||
isValidOutput = Array.isArray(res) && isNumArrayRec(res, 3, 0); | ||
if (!isValidOutput) { | ||
throw new InferenceOutputError("Expected Array<number[][] | number[] | number>"); | ||
throw new InferenceOutputError("Expected Array<number[][][] | number[][] | number[] | number>"); | ||
} | ||
return res; | ||
} |
Sorry, the diff of this file is not supported yet
226960