@huggingface/inference 2.5.1 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -509,7 +509,7 @@ export type FeatureExtractionArgs = BaseArgs & {
509
509
  inputs: string | string[];
510
510
  };
511
511
  /**
512
- * 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.
512
+ * 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).
513
513
  */
514
514
  export type FeatureExtractionOutput = (number | number[] | number[][])[];
515
515
  /**
package/dist/index.js CHANGED
@@ -558,9 +558,9 @@ async function featureExtraction(args, options) {
558
558
  return arr.every((x) => typeof x === "number");
559
559
  }
560
560
  };
561
- isValidOutput = Array.isArray(res) && isNumArrayRec(res, 2, 0);
561
+ isValidOutput = Array.isArray(res) && isNumArrayRec(res, 3, 0);
562
562
  if (!isValidOutput) {
563
- throw new InferenceOutputError("Expected Array<number[][] | number[] | number>");
563
+ throw new InferenceOutputError("Expected Array<number[][][] | number[][] | number[] | number>");
564
564
  }
565
565
  return res;
566
566
  }
package/dist/index.mjs CHANGED
@@ -506,9 +506,9 @@ async function featureExtraction(args, options) {
506
506
  return arr.every((x) => typeof x === "number");
507
507
  }
508
508
  };
509
- isValidOutput = Array.isArray(res) && isNumArrayRec(res, 2, 0);
509
+ isValidOutput = Array.isArray(res) && isNumArrayRec(res, 3, 0);
510
510
  if (!isValidOutput) {
511
- throw new InferenceOutputError("Expected Array<number[][] | number[] | number>");
511
+ throw new InferenceOutputError("Expected Array<number[][][] | number[][] | number[] | number>");
512
512
  }
513
513
  return res;
514
514
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huggingface/inference",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "packageManager": "pnpm@8.3.1",
5
5
  "license": "MIT",
6
6
  "author": "Tim Mikeladze <tim.mikeladze@gmail.com>",
@@ -14,7 +14,7 @@ export type FeatureExtractionArgs = BaseArgs & {
14
14
  };
15
15
 
16
16
  /**
17
- * 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.
17
+ * 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).
18
18
  */
19
19
  export type FeatureExtractionOutput = (number | number[] | number[][])[];
20
20
 
@@ -46,10 +46,10 @@ export async function featureExtraction(
46
46
  }
47
47
  };
48
48
 
49
- isValidOutput = Array.isArray(res) && isNumArrayRec(res, 2, 0);
49
+ isValidOutput = Array.isArray(res) && isNumArrayRec(res, 3, 0);
50
50
 
51
51
  if (!isValidOutput) {
52
- throw new InferenceOutputError("Expected Array<number[][] | number[] | number>");
52
+ throw new InferenceOutputError("Expected Array<number[][][] | number[][] | number[] | number>");
53
53
  }
54
54
  return res;
55
55
  }