@huggingface/transformers 3.0.0-alpha.0 → 3.0.0-alpha.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.
@@ -1,5 +1,3 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_onnxruntime_node_6a60201e__ from "onnxruntime-node";
2
- import * as __WEBPACK_EXTERNAL_MODULE_sharp__ from "sharp";
3
1
  /******/ var __webpack_modules__ = ({
4
2
 
5
3
  /***/ "./node_modules/onnxruntime-web/dist/ort-wasm-simd-threaded.jsep.wasm":
@@ -12,27 +10,13 @@ module.exports = __webpack_require__.p + "ort-wasm-simd-threaded.jsep.wasm";
12
10
 
13
11
  /***/ }),
14
12
 
15
- /***/ "onnxruntime-node":
16
- /*!***********************************!*\
17
- !*** external "onnxruntime-node" ***!
18
- \***********************************/
19
- /***/ ((module) => {
20
-
21
- var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
22
- var y = x => () => x
23
- module.exports = __WEBPACK_EXTERNAL_MODULE_onnxruntime_node_6a60201e__;
24
-
25
- /***/ }),
26
-
27
- /***/ "sharp":
28
- /*!************************!*\
29
- !*** external "sharp" ***!
30
- \************************/
31
- /***/ ((module) => {
13
+ /***/ "?2ce3":
14
+ /*!**********************************!*\
15
+ !*** onnxruntime-node (ignored) ***!
16
+ \**********************************/
17
+ /***/ (() => {
32
18
 
33
- var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
34
- var y = x => () => x
35
- module.exports = __WEBPACK_EXTERNAL_MODULE_sharp__;
19
+ /* (ignored) */
36
20
 
37
21
  /***/ }),
38
22
 
@@ -56,6 +40,16 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_sharp__;
56
40
 
57
41
  /***/ }),
58
42
 
43
+ /***/ "?2b25":
44
+ /*!***********************!*\
45
+ !*** sharp (ignored) ***!
46
+ \***********************/
47
+ /***/ (() => {
48
+
49
+ /* (ignored) */
50
+
51
+ /***/ }),
52
+
59
53
  /***/ "?569f":
60
54
  /*!********************!*\
61
55
  !*** fs (ignored) ***!
@@ -6396,6 +6390,7 @@ ${a}`,d=n.createShaderModule({code:l,label:t.name});ve("verbose",()=>`[WebGPU] $
6396
6390
  \******************************/
6397
6391
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
6398
6392
 
6393
+ var onnxruntime_node__WEBPACK_IMPORTED_MODULE_1___namespace_cache;
6399
6394
  __webpack_require__.r(__webpack_exports__);
6400
6395
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6401
6396
  /* harmony export */ "Tensor": () => (/* reexport safe */ onnxruntime_common__WEBPACK_IMPORTED_MODULE_3__.Tensor),
@@ -6405,7 +6400,7 @@ __webpack_require__.r(__webpack_exports__);
6405
6400
  /* harmony export */ "isONNXTensor": () => (/* binding */ isONNXTensor)
6406
6401
  /* harmony export */ });
6407
6402
  /* harmony import */ var _env_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../env.js */ "./src/env.js");
6408
- /* harmony import */ var onnxruntime_node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! onnxruntime-node */ "onnxruntime-node");
6403
+ /* harmony import */ var onnxruntime_node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! onnxruntime-node */ "?2ce3");
6409
6404
  /* harmony import */ var onnxruntime_web_webgpu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! onnxruntime-web/webgpu */ "./node_modules/onnxruntime-web/dist/ort.webgpu.bundle.min.mjs");
6410
6405
  /* harmony import */ var onnxruntime_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! onnxruntime-common */ "./node_modules/onnxruntime-common/dist/esm/index.js");
6411
6406
  /**
@@ -6442,7 +6437,7 @@ const supportedExecutionProviders = [];
6442
6437
  let defaultExecutionProviders;
6443
6438
  let ONNX;
6444
6439
  if (_env_js__WEBPACK_IMPORTED_MODULE_0__.apis.IS_NODE_ENV) {
6445
- ONNX = onnxruntime_node__WEBPACK_IMPORTED_MODULE_1__["default"] ?? onnxruntime_node__WEBPACK_IMPORTED_MODULE_1__;
6440
+ ONNX = onnxruntime_node__WEBPACK_IMPORTED_MODULE_1__ ?? /*#__PURE__*/ (onnxruntime_node__WEBPACK_IMPORTED_MODULE_1___namespace_cache || (onnxruntime_node__WEBPACK_IMPORTED_MODULE_1___namespace_cache = __webpack_require__.t(onnxruntime_node__WEBPACK_IMPORTED_MODULE_1__, 2)));
6446
6441
  supportedExecutionProviders.push('cpu');
6447
6442
  defaultExecutionProviders = ['cpu'];
6448
6443
  } else {
@@ -6520,6 +6515,9 @@ if (ONNX_ENV?.wasm) {
6520
6515
  // We use remote wasm files by default to make it easier for newer users.
6521
6516
  // In practice, users should probably self-host the necessary .wasm files.
6522
6517
  // ONNX_ENV.wasm.wasmPaths = 'https://cdn.jsdelivr.net/npm/onnxruntime-web@1.19.0-dev.20240804-ee2fe87e2d/dist/';
6518
+ // console.log(apis.IS_FS_AVAILABLE);
6519
+ console.log(_env_js__WEBPACK_IMPORTED_MODULE_0__.apis);
6520
+ console.log(import.meta.env);
6523
6521
 
6524
6522
  // TODO: Add support for loading WASM files from cached buffer when we upgrade to onnxruntime-web@1.19.0
6525
6523
  // https://github.com/microsoft/onnxruntime/pull/21534
@@ -29346,7 +29344,7 @@ __webpack_require__.r(__webpack_exports__);
29346
29344
  /* harmony import */ var _hub_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hub.js */ "./src/utils/hub.js");
29347
29345
  /* harmony import */ var _env_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../env.js */ "./src/env.js");
29348
29346
  /* harmony import */ var _tensor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./tensor.js */ "./src/utils/tensor.js");
29349
- /* harmony import */ var sharp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! sharp */ "sharp");
29347
+ /* harmony import */ var sharp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! sharp */ "?2b25");
29350
29348
 
29351
29349
  /**
29352
29350
  * @file Helper module for image processing.
@@ -29381,7 +29379,7 @@ if (BROWSER_ENV) {
29381
29379
  loadImageFunction = self.createImageBitmap;
29382
29380
  ImageDataClass = self.ImageData;
29383
29381
 
29384
- } else if (sharp__WEBPACK_IMPORTED_MODULE_3__["default"]) {
29382
+ } else if (sharp__WEBPACK_IMPORTED_MODULE_3__) {
29385
29383
  // Running in Node.js, electron, or other non-browser environment
29386
29384
 
29387
29385
  loadImageFunction = async (/**@type {sharp.Sharp}*/img) => {
@@ -29522,7 +29520,7 @@ class RawImage {
29522
29520
 
29523
29521
  } else {
29524
29522
  // Use sharp.js to read (and possible resize) the image.
29525
- const img = (0,sharp__WEBPACK_IMPORTED_MODULE_3__["default"])(await blob.arrayBuffer());
29523
+ const img = sharp__WEBPACK_IMPORTED_MODULE_3__(await blob.arrayBuffer());
29526
29524
 
29527
29525
  return await loadImageFunction(img);
29528
29526
  }
@@ -30083,7 +30081,7 @@ class RawImage {
30083
30081
  throw new Error('toSharp() is only supported in server-side environments.')
30084
30082
  }
30085
30083
 
30086
- return (0,sharp__WEBPACK_IMPORTED_MODULE_3__["default"])(this.data, {
30084
+ return sharp__WEBPACK_IMPORTED_MODULE_3__(this.data, {
30087
30085
  raw: {
30088
30086
  width: this.width,
30089
30087
  height: this.height,
@@ -32608,6 +32606,36 @@ function quantize_embeddings(tensor, precision) {
32608
32606
  /******/ }
32609
32607
  /******/
32610
32608
  /************************************************************************/
32609
+ /******/ /* webpack/runtime/create fake namespace object */
32610
+ /******/ (() => {
32611
+ /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
32612
+ /******/ var leafPrototypes;
32613
+ /******/ // create a fake namespace object
32614
+ /******/ // mode & 1: value is a module id, require it
32615
+ /******/ // mode & 2: merge all properties of value into the ns
32616
+ /******/ // mode & 4: return value when already ns object
32617
+ /******/ // mode & 16: return value when it's Promise-like
32618
+ /******/ // mode & 8|1: behave like require
32619
+ /******/ __webpack_require__.t = function(value, mode) {
32620
+ /******/ if(mode & 1) value = this(value);
32621
+ /******/ if(mode & 8) return value;
32622
+ /******/ if(typeof value === 'object' && value) {
32623
+ /******/ if((mode & 4) && value.__esModule) return value;
32624
+ /******/ if((mode & 16) && typeof value.then === 'function') return value;
32625
+ /******/ }
32626
+ /******/ var ns = Object.create(null);
32627
+ /******/ __webpack_require__.r(ns);
32628
+ /******/ var def = {};
32629
+ /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
32630
+ /******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
32631
+ /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
32632
+ /******/ }
32633
+ /******/ def['default'] = () => (value);
32634
+ /******/ __webpack_require__.d(ns, def);
32635
+ /******/ return ns;
32636
+ /******/ };
32637
+ /******/ })();
32638
+ /******/
32611
32639
  /******/ /* webpack/runtime/define property getters */
32612
32640
  /******/ (() => {
32613
32641
  /******/ // define getter functions for harmony exports