@huggingface/transformers 3.4.2 → 3.5.0

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.
Files changed (47) hide show
  1. package/README.md +2 -2
  2. package/dist/ort-wasm-simd-threaded.jsep.mjs +105 -124
  3. package/dist/ort-wasm-simd-threaded.jsep.wasm +0 -0
  4. package/dist/transformers.js +1374 -1462
  5. package/dist/transformers.js.map +1 -1
  6. package/dist/transformers.min.js +1 -1
  7. package/dist/transformers.min.js.map +1 -1
  8. package/dist/transformers.node.cjs +177 -67
  9. package/dist/transformers.node.cjs.map +1 -1
  10. package/dist/transformers.node.min.cjs +1 -1
  11. package/dist/transformers.node.min.cjs.map +1 -1
  12. package/dist/transformers.node.min.mjs +1 -1
  13. package/dist/transformers.node.min.mjs.map +1 -1
  14. package/dist/transformers.node.mjs +177 -67
  15. package/dist/transformers.node.mjs.map +1 -1
  16. package/dist/transformers.web.js +177 -67
  17. package/dist/transformers.web.js.map +1 -1
  18. package/dist/transformers.web.min.js +1 -1
  19. package/dist/transformers.web.min.js.map +1 -1
  20. package/package.json +6 -6
  21. package/src/configs.js +6 -0
  22. package/src/env.js +3 -2
  23. package/src/generation/logits_process.js +4 -2
  24. package/src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js +1 -6
  25. package/src/models/seamless_m4t/feature_extraction_seamless_m4t.js +1 -6
  26. package/src/models/wespeaker/feature_extraction_wespeaker.js +1 -6
  27. package/src/models.js +26 -13
  28. package/src/tokenizers.js +23 -4
  29. package/src/utils/audio.js +11 -2
  30. package/src/utils/data-structures.js +53 -0
  31. package/src/utils/hub.js +30 -22
  32. package/types/configs.d.ts +8 -0
  33. package/types/configs.d.ts.map +1 -1
  34. package/types/env.d.ts +4 -2
  35. package/types/env.d.ts.map +1 -1
  36. package/types/generation/logits_process.d.ts.map +1 -1
  37. package/types/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.d.ts.map +1 -1
  38. package/types/models/seamless_m4t/feature_extraction_seamless_m4t.d.ts.map +1 -1
  39. package/types/models/wespeaker/feature_extraction_wespeaker.d.ts.map +1 -1
  40. package/types/models.d.ts.map +1 -1
  41. package/types/tokenizers.d.ts.map +1 -1
  42. package/types/utils/audio.d.ts +2 -1
  43. package/types/utils/audio.d.ts.map +1 -1
  44. package/types/utils/data-structures.d.ts +32 -0
  45. package/types/utils/data-structures.d.ts.map +1 -1
  46. package/types/utils/hub.d.ts.map +1 -1
  47. package/types/utils/tensor.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huggingface/transformers",
3
- "version": "3.4.2",
3
+ "version": "3.5.0",
4
4
  "description": "State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!",
5
5
  "main": "./src/transformers.js",
6
6
  "types": "./types/transformers.d.ts",
@@ -27,7 +27,7 @@
27
27
  "typegen": "tsc --build",
28
28
  "dev": "webpack serve --no-client-overlay",
29
29
  "build": "webpack && npm run typegen",
30
- "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --verbose",
30
+ "test": "node --experimental-vm-modules --expose-gc node_modules/jest/bin/jest.js --verbose",
31
31
  "readme": "python ./docs/scripts/build_readme.py",
32
32
  "docs-api": "node ./docs/scripts/generate.js",
33
33
  "docs-preview": "doc-builder preview transformers.js ./docs/source/ --not_python_module",
@@ -55,10 +55,10 @@
55
55
  },
56
56
  "homepage": "https://github.com/huggingface/transformers.js#readme",
57
57
  "dependencies": {
58
- "@huggingface/jinja": "^0.3.3",
59
- "onnxruntime-node": "1.20.1",
60
- "onnxruntime-web": "1.22.0-dev.20250306-ccf8fdd9ea",
61
- "sharp": "^0.33.5"
58
+ "@huggingface/jinja": "^0.3.4",
59
+ "onnxruntime-node": "1.21.0",
60
+ "onnxruntime-web": "1.22.0-dev.20250409-89f8206ba4",
61
+ "sharp": "^0.34.1"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/jest": "^29.5.14",
package/src/configs.js CHANGED
@@ -404,6 +404,7 @@ export class AutoConfig {
404
404
  /**
405
405
  * Transformers.js-specific configuration, possibly present in config.json under the key `transformers.js_config`.
406
406
  * @typedef {Object} TransformersJSConfig
407
+ * @property {Record<import('./utils/devices.js').DeviceType, DeviceConfig>} [device_config] Device-specific configurations.
407
408
  * @property {import('./utils/tensor.js').DataType|Record<import('./utils/dtypes.js').DataType, import('./utils/tensor.js').DataType>} [kv_cache_dtype] The data type of the key-value cache.
408
409
  * @property {Record<string, number>} [free_dimension_overrides] Override the free dimensions of the model.
409
410
  * See https://onnxruntime.ai/docs/tutorials/web/env-flags-and-session-options.html#freedimensionoverrides
@@ -412,3 +413,8 @@ export class AutoConfig {
412
413
  * @property {import('./utils/dtypes.js').DataType|Record<string, import('./utils/dtypes.js').DataType>} [dtype] The default data type to use for the model.
413
414
  * @property {import('./utils/hub.js').ExternalData|Record<string, import('./utils/hub.js').ExternalData>} [use_external_data_format=false] Whether to load the model using the external data format (used for models >= 2GB in size).
414
415
  */
416
+
417
+ /**
418
+ * Device-specific configuration options.
419
+ * @typedef {Omit<TransformersJSConfig, "device" | "device_config">} DeviceConfig
420
+ */
package/src/env.js CHANGED
@@ -26,7 +26,7 @@ import fs from 'fs';
26
26
  import path from 'path';
27
27
  import url from 'url';
28
28
 
29
- const VERSION = '3.4.2';
29
+ const VERSION = '3.5.0';
30
30
 
31
31
  // Check if various APIs are available (depends on environment)
32
32
  const IS_BROWSER_ENV = typeof window !== "undefined" && typeof window.document !== "undefined";
@@ -118,7 +118,8 @@ const localModelPath = RUNNING_LOCALLY
118
118
  * @property {string} cacheDir The directory to use for caching files with the file system. By default, it is `./.cache`.
119
119
  * @property {boolean} useCustomCache Whether to use a custom cache system (defined by `customCache`), defaults to `false`.
120
120
  * @property {Object} customCache The custom cache to use. Defaults to `null`. Note: this must be an object which
121
- * implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache
121
+ * implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache.
122
+ * If you wish, you may also return a `Promise<string>` from the `match` function if you'd like to use a file path instead of `Promise<Response>`.
122
123
  */
123
124
 
124
125
  /** @type {TransformersEnvironment} */
@@ -548,13 +548,15 @@ export class NoBadWordsLogitsProcessor extends LogitsProcessor {
548
548
  const batch_logits_data = /** @type {Float32Array} */(logits[i].data);
549
549
  const ids = input_ids[i];
550
550
  for (const bad_word_ids of this.bad_words_ids) {
551
+ // There aren't enough tokens to match the banned sequence
552
+ if (ids.length < bad_word_ids.length - 1) continue;
553
+
551
554
  // Whether to modify the logits of the last token in the bad word id sequence
552
555
  let mark = true;
553
556
 
554
557
  // For each bad word in the list, if the current sequence of input ids ends with this sequence (excluding the last),
555
558
  // then we set the logits of the last bad word id to -Infinity.
556
- for (let j = 1; j <= bad_word_ids.length - 1 && bad_word_ids.length < ids.length; ++j) {
557
-
559
+ for (let j = 1; j <= bad_word_ids.length - 1; ++j) {
558
560
  // NOTE: We use != instead of !== to compare bigint and number
559
561
  // @ts-ignore
560
562
  if (bad_word_ids.at(-j - 1) != ids.at(-j)) {
@@ -10,7 +10,7 @@ export class ASTFeatureExtractor extends FeatureExtractor {
10
10
 
11
11
  const sampling_rate = this.config.sampling_rate;
12
12
  const mel_filters = mel_filter_bank(
13
- 256, // num_frequency_bins
13
+ 257, // num_frequency_bins
14
14
  this.config.num_mel_bins, // num_mel_filters
15
15
  20, // min_frequency
16
16
  Math.floor(sampling_rate / 2), // max_frequency
@@ -19,11 +19,6 @@ export class ASTFeatureExtractor extends FeatureExtractor {
19
19
  "kaldi", // mel_scale
20
20
  true, // triangularize_in_mel_space
21
21
  );
22
-
23
- // Do padding:
24
- for (let i = 0; i < mel_filters.length; ++i) {
25
- mel_filters[i].push(0);
26
- }
27
22
  this.mel_filters = mel_filters;
28
23
 
29
24
  this.window = window_function(400, 'hann', {
@@ -9,7 +9,7 @@ export class SeamlessM4TFeatureExtractor extends FeatureExtractor {
9
9
 
10
10
  const sampling_rate = this.config.sampling_rate;
11
11
  const mel_filters = mel_filter_bank(
12
- 256, // num_frequency_bins
12
+ 257, // num_frequency_bins
13
13
  this.config.num_mel_bins, // num_mel_filters
14
14
  20, // min_frequency
15
15
  Math.floor(sampling_rate / 2), // max_frequency
@@ -18,11 +18,6 @@ export class SeamlessM4TFeatureExtractor extends FeatureExtractor {
18
18
  "kaldi", // mel_scale
19
19
  true, // triangularize_in_mel_space
20
20
  );
21
-
22
- // Do padding:
23
- for (let i = 0; i < mel_filters.length; ++i) {
24
- mel_filters[i].push(0);
25
- }
26
21
  this.mel_filters = mel_filters;
27
22
 
28
23
  this.window = window_function(400, 'povey', {
@@ -10,7 +10,7 @@ export class WeSpeakerFeatureExtractor extends FeatureExtractor {
10
10
 
11
11
  const sampling_rate = this.config.sampling_rate;
12
12
  const mel_filters = mel_filter_bank(
13
- 256, // num_frequency_bins
13
+ 257, // num_frequency_bins
14
14
  this.config.num_mel_bins, // num_mel_filters
15
15
  20, // min_frequency
16
16
  Math.floor(sampling_rate / 2), // max_frequency
@@ -19,11 +19,6 @@ export class WeSpeakerFeatureExtractor extends FeatureExtractor {
19
19
  "kaldi", // mel_scale
20
20
  true, // triangularize_in_mel_space
21
21
  );
22
-
23
- // Do padding:
24
- for (let i = 0; i < mel_filters.length; ++i) {
25
- mel_filters[i].push(0);
26
- }
27
22
  this.mel_filters = mel_filters;
28
23
 
29
24
  this.window = window_function(400, 'hamming', {
package/src/models.js CHANGED
@@ -116,7 +116,7 @@ import { RawImage } from './utils/image.js';
116
116
  import { dynamic_time_warping, max, medianFilter } from './utils/maths.js';
117
117
  import { EosTokenCriteria, MaxLengthCriteria, StoppingCriteriaList } from './generation/stopping_criteria.js';
118
118
  import { LogitsSampler } from './generation/logits_sampler.js';
119
- import { apis } from './env.js';
119
+ import { apis, env } from './env.js';
120
120
 
121
121
  import { WhisperGenerationConfig } from './models/whisper/generation_whisper.js';
122
122
  import { whisper_language_to_code } from './models/whisper/common_whisper.js';
@@ -158,7 +158,8 @@ const MODEL_CLASS_TO_NAME_MAPPING = new Map();
158
158
  * @private
159
159
  */
160
160
  async function getSession(pretrained_model_name_or_path, fileName, options) {
161
- const custom_config = options.config?.['transformers.js_config'] ?? {};
161
+ let custom_config = options.config?.['transformers.js_config'] ?? {};
162
+
162
163
  let device = options.device ?? custom_config.device;
163
164
  if (device && typeof device !== 'string') {
164
165
  if (device.hasOwnProperty(fileName)) {
@@ -173,8 +174,18 @@ async function getSession(pretrained_model_name_or_path, fileName, options) {
173
174
  const selectedDevice = /** @type {import("./utils/devices.js").DeviceType} */(
174
175
  device ?? (apis.IS_NODE_ENV ? 'cpu' : 'wasm')
175
176
  );
177
+
176
178
  const executionProviders = deviceToExecutionProviders(selectedDevice);
177
179
 
180
+ // Update custom config with the selected device's config, if it exists
181
+ const device_config = custom_config.device_config ?? {};
182
+ if (device_config.hasOwnProperty(selectedDevice)) {
183
+ custom_config = {
184
+ ...custom_config,
185
+ ...device_config[selectedDevice],
186
+ };
187
+ }
188
+
178
189
  // If options.dtype is specified, we use it to choose the suffix for the model file.
179
190
  // Otherwise, we use the default dtype for the device.
180
191
  let dtype = options.dtype ?? custom_config.dtype;
@@ -191,11 +202,11 @@ async function getSession(pretrained_model_name_or_path, fileName, options) {
191
202
  // Try to choose the auto dtype based on the custom config
192
203
  let config_dtype = custom_config.dtype;
193
204
  if (typeof config_dtype !== 'string') {
194
- config_dtype = config_dtype[fileName];
205
+ config_dtype = config_dtype?.[fileName];
195
206
  }
196
207
 
197
208
  if (config_dtype && config_dtype !== DATA_TYPES.auto && DATA_TYPES.hasOwnProperty(config_dtype)) {
198
- // Defined by the custom config, and is not "auto"
209
+ // Defined by the config, and is not "auto"
199
210
  dtype = config_dtype;
200
211
  } else {
201
212
  // Choose default dtype based on device, falling back to fp32
@@ -212,10 +223,11 @@ async function getSession(pretrained_model_name_or_path, fileName, options) {
212
223
  }
213
224
 
214
225
  // Only valid for models with a decoder
215
- const kv_cache_dtype = custom_config.kv_cache_dtype
216
- ? (typeof custom_config.kv_cache_dtype === 'string'
217
- ? custom_config.kv_cache_dtype
218
- : custom_config.kv_cache_dtype[selectedDtype] ?? 'float32')
226
+ const kv_cache_dtype_config = custom_config.kv_cache_dtype;
227
+ const kv_cache_dtype = kv_cache_dtype_config
228
+ ? (typeof kv_cache_dtype_config === 'string'
229
+ ? kv_cache_dtype_config
230
+ : kv_cache_dtype_config[selectedDtype] ?? 'float32')
219
231
  : undefined;
220
232
 
221
233
  if (kv_cache_dtype && !['float32', 'float16'].includes(kv_cache_dtype)) {
@@ -243,14 +255,15 @@ async function getSession(pretrained_model_name_or_path, fileName, options) {
243
255
  session_options.freeDimensionOverrides ??= free_dimension_overrides;
244
256
  } else if (selectedDevice.startsWith('webnn') && !session_options.freeDimensionOverrides) {
245
257
  console.warn(
246
- 'WebNN does not currently support dynamic shapes and requires `free_dimension_overrides` to be set in config.json as a field within "transformers.js_config". ' +
247
- 'When `free_dimension_overrides` is not set, you may experience significant performance degradation.'
258
+ `WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${selectedDevice}"]. ` +
259
+ `When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`
248
260
  );
249
261
  }
250
262
 
251
- const bufferOrPathPromise = getModelFile(pretrained_model_name_or_path, modelFileName, true, options, apis.IS_NODE_ENV);
263
+ const return_path = apis.IS_NODE_ENV && env.useFSCache;
264
+ const bufferOrPathPromise = getModelFile(pretrained_model_name_or_path, modelFileName, true, options, return_path);
252
265
 
253
- // handle onnx external data files
266
+ // Handle onnx external data files
254
267
  const use_external_data_format = options.use_external_data_format ?? custom_config.use_external_data_format;
255
268
  /** @type {Promise<string|{path: string, data: Uint8Array}>[]} */
256
269
  let externalDataPromises = [];
@@ -276,7 +289,7 @@ async function getSession(pretrained_model_name_or_path, fileName, options) {
276
289
  const path = `${baseName}_data${i === 0 ? '' : '_' + i}`;
277
290
  const fullPath = `${options.subfolder ?? ''}/${path}`;
278
291
  externalDataPromises.push(new Promise(async (resolve, reject) => {
279
- const data = await getModelFile(pretrained_model_name_or_path, fullPath, true, options, apis.IS_NODE_ENV);
292
+ const data = await getModelFile(pretrained_model_name_or_path, fullPath, true, options, return_path);
280
293
  resolve(data instanceof Uint8Array ? { path, data } : path);
281
294
  }));
282
295
  }
package/src/tokenizers.js CHANGED
@@ -43,6 +43,7 @@ import {
43
43
  TokenLattice,
44
44
  CharTrie,
45
45
  DictionarySplitter,
46
+ LRUCache,
46
47
  } from './utils/data-structures.js';
47
48
 
48
49
  import { Template } from '@huggingface/jinja';
@@ -727,8 +728,24 @@ class BPE extends TokenizerModel {
727
728
 
728
729
  this.ignore_merges = this.config.ignore_merges ?? false;
729
730
 
730
- /** @type {Map<string, string[]>} */
731
- this.cache = new Map();
731
+ /**
732
+ * The maximum length we should cache in a model.
733
+ * Strings that are too long have minimal chances to cache hit anyway
734
+ */
735
+ this.max_length_to_cache = 256;
736
+
737
+ /**
738
+ * The default capacity for a `BPE`'s internal cache.
739
+ */
740
+ this.cache_capacity = 10000;
741
+ this.cache = new LRUCache(this.cache_capacity);
742
+ }
743
+
744
+ /**
745
+ * Clears the cache.
746
+ */
747
+ clear_cache() {
748
+ this.cache.clear();
732
749
  }
733
750
 
734
751
  /**
@@ -855,8 +872,10 @@ class BPE extends TokenizerModel {
855
872
  }
856
873
  }
857
874
 
858
- // Save the result to the cache
859
- this.cache.set(token, result);
875
+ if (token.length < this.max_length_to_cache) {
876
+ // Save the result to the cache
877
+ this.cache.put(token, result);
878
+ }
860
879
 
861
880
  return result;
862
881
  }
@@ -235,7 +235,8 @@ function linspace(start, end, num) {
235
235
  * various implementation exist, which differ in the number of filters, the shape of the filters, the way the filters
236
236
  * are spaced, the bandwidth of the filters, and the manner in which the spectrum is warped. The goal of these
237
237
  * features is to approximate the non-linear human perception of the variation in pitch with respect to the frequency.
238
- * @param {number} num_frequency_bins Number of frequencies used to compute the spectrogram (should be the same as in `stft`).
238
+ * @param {number} num_frequency_bins Number of frequency bins (should be the same as `n_fft // 2 + 1`
239
+ * where `n_fft` is the size of the Fourier Transform used to compute the spectrogram).
239
240
  * @param {number} num_mel_filters Number of mel filters to generate.
240
241
  * @param {number} min_frequency Lowest frequency of interest in Hz.
241
242
  * @param {number} max_frequency Highest frequency of interest in Hz. This should not exceed `sampling_rate / 2`.
@@ -261,6 +262,14 @@ export function mel_filter_bank(
261
262
  throw new Error('norm must be one of null or "slaney"');
262
263
  }
263
264
 
265
+ if (num_frequency_bins < 2) {
266
+ throw new Error(`Require num_frequency_bins: ${num_frequency_bins} >= 2`);
267
+ }
268
+
269
+ if (min_frequency > max_frequency) {
270
+ throw new Error(`Require min_frequency: ${min_frequency} <= max_frequency: ${max_frequency}`);
271
+ }
272
+
264
273
  const mel_min = hertz_to_mel(min_frequency, mel_scale);
265
274
  const mel_max = hertz_to_mel(max_frequency, mel_scale);
266
275
  const mel_freqs = linspace(mel_min, mel_max, num_mel_filters + 2);
@@ -269,7 +278,7 @@ export function mel_filter_bank(
269
278
  let fft_freqs; // frequencies of FFT bins in Hz
270
279
 
271
280
  if (triangularize_in_mel_space) {
272
- const fft_bin_width = sampling_rate / (num_frequency_bins * 2);
281
+ const fft_bin_width = sampling_rate / ((num_frequency_bins - 1) * 2);
273
282
  fft_freqs = hertz_to_mel(Float64Array.from({ length: num_frequency_bins }, (_, i) => i * fft_bin_width), mel_scale);
274
283
  filter_freqs = mel_freqs;
275
284
  } else {
@@ -519,3 +519,56 @@ export class DictionarySplitter {
519
519
  return result;
520
520
  }
521
521
  }
522
+
523
+ /**
524
+ * A simple Least Recently Used (LRU) cache implementation in JavaScript.
525
+ * This cache stores key-value pairs and evicts the least recently used item
526
+ * when the capacity is exceeded.
527
+ */
528
+ export class LRUCache {
529
+ /**
530
+ * Creates an LRUCache instance.
531
+ * @param {number} capacity The maximum number of items the cache can hold.
532
+ */
533
+ constructor(capacity) {
534
+ this.capacity = capacity;
535
+ this.cache = new Map();
536
+ }
537
+
538
+ /**
539
+ * Retrieves the value associated with the given key and marks the key as recently used.
540
+ * @param {any} key The key to retrieve.
541
+ * @returns {any} The value associated with the key, or undefined if the key does not exist.
542
+ */
543
+ get(key) {
544
+ if (!this.cache.has(key)) return undefined;
545
+ const value = this.cache.get(key);
546
+ this.cache.delete(key);
547
+ this.cache.set(key, value);
548
+ return value;
549
+ }
550
+
551
+ /**
552
+ * Inserts or updates the key-value pair in the cache.
553
+ * If the key already exists, it is updated and marked as recently used.
554
+ * If the cache exceeds its capacity, the least recently used item is evicted.
555
+ * @param {any} key The key to add or update.
556
+ * @param {any} value The value to associate with the key.
557
+ */
558
+ put(key, value) {
559
+ if (this.cache.has(key)) {
560
+ this.cache.delete(key);
561
+ }
562
+ this.cache.set(key, value);
563
+ if (this.cache.size > this.capacity) {
564
+ this.cache.delete(this.cache.keys().next().value);
565
+ }
566
+ }
567
+
568
+ /**
569
+ * Clears the cache.
570
+ */
571
+ clear() {
572
+ this.cache.clear();
573
+ }
574
+ }
package/src/utils/hub.js CHANGED
@@ -418,6 +418,22 @@ export async function getModelFile(path_or_repo_id, filename, fatal = true, opti
418
418
  // First, check if the a caching backend is available
419
419
  // If no caching mechanism available, will download the file every time
420
420
  let cache;
421
+ if (!cache && env.useCustomCache) {
422
+ // Allow the user to specify a custom cache system.
423
+ if (!env.customCache) {
424
+ throw Error('`env.useCustomCache=true`, but `env.customCache` is not defined.')
425
+ }
426
+
427
+ // Check that the required methods are defined:
428
+ if (!env.customCache.match || !env.customCache.put) {
429
+ throw new Error(
430
+ "`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. " +
431
+ "For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache"
432
+ )
433
+ }
434
+ cache = env.customCache;
435
+ }
436
+
421
437
  if (!cache && env.useBrowserCache) {
422
438
  if (typeof caches === 'undefined') {
423
439
  throw Error('Browser cache is not available in this environment.')
@@ -435,28 +451,14 @@ export async function getModelFile(path_or_repo_id, filename, fatal = true, opti
435
451
  }
436
452
 
437
453
  if (!cache && env.useFSCache) {
438
- // TODO throw error if not available
454
+ if (!apis.IS_FS_AVAILABLE) {
455
+ throw Error('File System Cache is not available in this environment.');
456
+ }
439
457
 
440
458
  // If `cache_dir` is not specified, use the default cache directory
441
459
  cache = new FileCache(options.cache_dir ?? env.cacheDir);
442
460
  }
443
461
 
444
- if (!cache && env.useCustomCache) {
445
- // Allow the user to specify a custom cache system.
446
- if (!env.customCache) {
447
- throw Error('`env.useCustomCache=true`, but `env.customCache` is not defined.')
448
- }
449
-
450
- // Check that the required methods are defined:
451
- if (!env.customCache.match || !env.customCache.put) {
452
- throw new Error(
453
- "`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. " +
454
- "For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache"
455
- )
456
- }
457
- cache = env.customCache;
458
- }
459
-
460
462
  const revision = options.revision ?? 'main';
461
463
  const requestURL = pathJoin(path_or_repo_id, filename);
462
464
 
@@ -638,7 +640,7 @@ export async function getModelFile(path_or_repo_id, filename, fatal = true, opti
638
640
  });
639
641
 
640
642
  if (result) {
641
- if (return_path) {
643
+ if (!apis.IS_NODE_ENV && return_path) {
642
644
  throw new Error("Cannot return path in a browser environment.")
643
645
  }
644
646
  return result;
@@ -647,12 +649,18 @@ export async function getModelFile(path_or_repo_id, filename, fatal = true, opti
647
649
  return response.filePath;
648
650
  }
649
651
 
650
- const path = await cache.match(cacheKey);
651
- if (path instanceof FileResponse) {
652
- return path.filePath;
652
+ // Otherwise, return the cached response (most likely a `FileResponse`).
653
+ // NOTE: A custom cache may return a Response, or a string (file path)
654
+ const cachedResponse = await cache?.match(cacheKey);
655
+ if (cachedResponse instanceof FileResponse) {
656
+ return cachedResponse.filePath;
657
+ } else if (cachedResponse instanceof Response) {
658
+ return new Uint8Array(await cachedResponse.arrayBuffer());
659
+ } else if (typeof cachedResponse === 'string') {
660
+ return cachedResponse;
653
661
  }
654
- throw new Error("Unable to return path for response.");
655
662
 
663
+ throw new Error("Unable to get model file path or buffer.");
656
664
  }
657
665
 
658
666
  /**
@@ -62,6 +62,10 @@ export type ProgressInfo = import("./utils/core.js").ProgressInfo;
62
62
  * Transformers.js-specific configuration, possibly present in config.json under the key `transformers.js_config`.
63
63
  */
64
64
  export type TransformersJSConfig = {
65
+ /**
66
+ * Device-specific configurations.
67
+ */
68
+ device_config?: Record<import("./utils/devices.js").DeviceType, DeviceConfig>;
65
69
  /**
66
70
  * The data type of the key-value cache.
67
71
  */
@@ -85,4 +89,8 @@ export type TransformersJSConfig = {
85
89
  */
86
90
  use_external_data_format?: import("./utils/hub.js").ExternalData | Record<string, import("./utils/hub.js").ExternalData>;
87
91
  };
92
+ /**
93
+ * Device-specific configuration options.
94
+ */
95
+ export type DeviceConfig = Omit<TransformersJSConfig, "device" | "device_config">;
88
96
  //# sourceMappingURL=configs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../src/configs.js"],"names":[],"mappings":"AA4PA;;;;GAIG;AACH,0CAHW,gBAAgB;;;IACd,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CA2EpC;AACD;;;GAGG;AACH;IAwBI;;;;;;;;OAQG;IACH,sDANW,MAAM,0EACN,iBAAiB,GAGf,OAAO,CAAC,gBAAgB,CAAC,CAqBrC;IArCD;;;OAGG;IACH,6BAGC;IAnBD,0BAA0B;IAC1B,YADW,MAAM,GAAC,IAAI,CACJ;IAElB,sBAAsB;IACtB,oBADW,OAAO,CACS;IAE3B,qBAAqB;IACrB,yBADW,MAAM,CACO;IAExB,mCAAmC;IACnC,0BADW,oBAAoB,CACN;IAQrB,uBAAkD;CAgCzD;AAED;;;;;GAKG;AACH;IArCI;;;;;;;;OAQG;IACH,sDANW,MAAM,0EACN,iBAAiB,GAGf,OAAO,CAAC,gBAAgB,CAAC,CAqBrC;CAcJ;gCA9WY,OAAO,gBAAgB,EAAE,iBAAiB;+BAI1C,OAAO,iBAAi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AAoB,EAAE,UAAU,EAAE,YAAY,CAAC;;;;qBAC7D,OAAO,mBAAmB,EAAE,QAAQ,GAAC,MAAM,CAAC,OAAO,mBAAmB,EAAE,QAAQ,EAAE,OAAO,mBAAmB,EAAE,QAAQ,CAAC;;;;;;+BACvH,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;;;aAGtB,OAAO,oBAAoB,EAAE,UAAU;;;;YACvC,OAAO,mBAAmB,EAAE,QAAQ,GAAC,MAAM,CAAC,MAAM,EAAE,OAAO,mBAAmB,EAAE,QAAQ,CAAC;;;;+BACzF,OAAO,gBAAgB,EAAE,YAAY,GAAC,MAAM,CAAC,MAAM,EAAE,OAAO,gBAAgB,EAAE,YAAY,CAAC;;;;;2BAK5F,IAAI,CAAC,oBAAoB,EAAE,QAAQ,GAAG,eAAe,CAAC"}
package/types/env.d.ts CHANGED
@@ -40,7 +40,8 @@ export const apis: Readonly<{
40
40
  * @property {string} cacheDir The directory to use for caching files with the file system. By default, it is `./.cache`.
41
41
  * @property {boolean} useCustomCache Whether to use a custom cache system (defined by `customCache`), defaults to `false`.
42
42
  * @property {Object} customCache The custom cache to use. Defaults to `null`. Note: this must be an object which
43
- * implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache
43
+ * implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache.
44
+ * If you wish, you may also return a `Promise<string>` from the `match` function if you'd like to use a file path instead of `Promise<Response>`.
44
45
  */
45
46
  /** @type {TransformersEnvironment} */
46
47
  export const env: TransformersEnvironment;
@@ -103,7 +104,8 @@ export type TransformersEnvironment = {
103
104
  useCustomCache: boolean;
104
105
  /**
105
106
  * The custom cache to use. Defaults to `null`. Note: this must be an object which
106
- * implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache
107
+ * implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache.
108
+ * If you wish, you may also return a `Promise<string>` from the `match` function if you'd like to use a file path instead of `Promise<Response>`.
107
109
  */
108
110
  customCache: any;
109
111
  };
@@ -1 +1 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.js"],"names":[],"mappings":"AA0CA;;GAEG;AACH;IACI,6EAA6E;;IAG7E,yDAAyD;;IAGzD,yCAAyC;;IAGzC,0CAA0C;;IAG1C,yCAAyC;;IAGzC,mDAAmD;;IAGnD,sDAAsD;;IAGtD,8CAA8C;;IAG9C,wCAAwC;;GAEzC;AA6BH;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,sCAAsC;AACtC,kBADW,uBAAuB,CA6BjC;;;;;;;;aAhDa,MAAM;;;;;cACN;QAAC,IAAI,EAAE,OAAO,CAAC,OAAO,oBAAoB,EAAE,GAAG,CAAC,CAAA;KAAC;;;;;uBAEjD,OAAO;;;;gBAEP,MAAM;;;;wBACN,MAAM;;;;;sBACN,OAAO;;;;oBAEP,MAAM;;;;WACN,OAAO;;;;qBACP,OAAO;;;;gBACP,OAAO;;;;cACP,MAAM;;;;oBACN,OAAO"}
1
+ {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.js"],"names":[],"mappings":"AA0CA;;GAEG;AACH;IACI,6EAA6E;;IAG7E,yDAAyD;;IAGzD,yCAAyC;;IAGzC,0CAA0C;;IAG1C,yCAAyC;;IAGzC,mDAAmD;;IAGnD,sDAAsD;;IAGtD,8CAA8C;;IAG9C,wCAAwC;;GAEzC;AA6BH;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,sCAAsC;AACtC,kBADW,uBAAuB,CA6BjC;;;;;;;;aAjDa,MAAM;;;;;cACN;QAAC,IAAI,EAAE,OAAO,CAAC,OAAO,oBAAoB,EAAE,GAAG,CAAC,CAAA;KAAC;;;;;uBAEjD,OAAO;;;;gBAEP,MAAM;;;;wBACN,MAAM;;;;;sBACN,OAAO;;;;oBAEP,MAAM;;;;WACN,OAAO;;;;qBACP,OAAO;;;;gBACP,OAAO;;;;cACP,MAAM;;;;oBACN,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"logits_process.d.ts","sourceRoot":"","sources":["../../src/generation/logits_process.js"],"names":[],"mappings":";KAQW,GAAG;UAAyB,GAAG;;AAE1C;;GAEG;AACH;IACI;;;;;;;OAOG;IACH,iBAJW,MAAM,EAAE,EAAE,UACV,MAAM,QAKhB;CACJ;;KAjBU,GAAG;UAAyB,GAAG;;AAoB1C;;GAEG;AACH;IACI;;;;;;;OAOG;IACH,iBAJW,MAAM,EAAE,EAAE,UACV,MAAM,QAKhB;CACJ;;KAnCU,GAAG;UAAyB,GAAG;;AAsC1C;;;;GAIG;AACH;IAMQ,kBAAoB;IAGxB;;;;OAIG;IACH,WAFW,eAAe,QAIzB;IAED;;;;OAIG;IACH,cAFW,eAAe,EAAE,QAI3B;IAED;;;;;OAKG;IACH,iBAHW,MAAM,EAAE,EAAE,UACV,MAAM,UAShB;IAED,wCAEC;CACJ;AAwCD;;GAEG;AACH;IACI;;;OAGG;IACH,0BAFW,MAAM,EAKhB;IADG,qBAAgC;IAGpC;;;;;OAKG;IACH,iBAJW,MAAM,EAAE,EAAE,UACV,MAAM,GACJ,MAAM,CAWlB;CACJ;AAED;;GAEG;AACH;IACI;;;;OAIG;IACH,wBAHW,MAAM,gBACN,MAAM,GAAC,MAAM,EAAE,EAMzB;IAFG,mBAA4B;IAC5B,uBAA+E;IAGnF;;;;;OAKG;IACH,iBAHW,MAAM,EAAE,EAAE,UACV,MAAM,UAahB;CACJ;AAED;;;;GAIG;AACH;IACI;;;;OAIG;IACH,mCAHW,MAAM,EAAE,eACR,MAAM,EAMhB;IAFG,gCAAkD;IAClD,oBAA8B;IAGlC;;;;;OAKG;IACH,iBAJW,MAAM,EAAE,EAAE,UACV,MAAM,GACJ,MAAM,CAYlB;CACJ;AAED;;GAEG;AACH;IACI;;;;OAIG;IACH,6BAHW,OAAO,yCAAyC,EAAE,uBAAuB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,MAAM,EAAE,EAAE,gBACV,MAAM,GAAC,MAAM,EAAE,EAMzB;IAFG,0BAAkC;IAClC,uBAA+E;IAGnF;;;;;OAKG;IACH,iBAJW,MAAM,EAAE,EAAE,UACV,MAAM,GACJ,MAAM,CA4BlB;CACJ;AAED;;;;;;;GAOG;AACH;IAEI;;;;;OAKG;IACH,4BAJW,MAAM,EAYhB;IADG,uBAAoC;IAGxC;;;;;OAKG;IACH,iBAJW,MAAM,EAAE,EAAE,UACV,MAAM,GACJ,MAAM,CAsBlB;CACJ;AAED;;;GAGG;AACH;IACI;;;;;OAKG;IACH,yBAJW,MAAM,EAgBhB;IADG,oBAA8B;IAGlC;;;;;OAKG;IACH,iBAJW,MAAM,EAAE,EAAE,UACV,MAAM,GACJ,MAAM,CAQlB;CACJ;AAED;;;GAGG;AACH;IACI;;;;;;;OAOG;IACH,mBANW,MAAM,0CAGd;QAAyB,YAAY,GAA7B,MAAM;QACW,kBAAkB,GAAnC,MAAM;KAChB,EAgBA;IAHG,cAAkB;IAClB,qBAAgC;IAChC,2BAA4C;CAEnD;AAED;;;GAGG;AACH;IACI;;;;;;OAMG;IACH,mBALW,MAAM,0CAEd;QAAyB,YAAY,GAA7B,MAAM;QACW,kBAAkB,GAAnC,MAAM;KAChB,EAYA;IAFG,cAAgD;IAChD,qBAAgC;CAEvC;uBA9sBsB,oBAAoB"}
1
+ {"version":3,"file":"logits_process.d.ts","sourceRoot":"","sources":["../../src/generation/logits_process.js"],"names":[],"mappings":";KAQW,GAAG;UAAyB,GAAG;;AAE1C;;GAEG;AACH;IACI;;;;;;;OAOG;IACH,iBAJW,MAAM,EAAE,EAAE,UACV,MAAM,QAKhB;CACJ;;KAjBU,GAAG;UAAyB,GAAG;;AAoB1C;;GAEG;AACH;IACI;;;;;;;OAOG;IACH,iBAJW,MAAM,EAAE,EAAE,UACV,MAAM,QAKhB;CACJ;;KAnCU,GAAG;UAAyB,GAAG;;AAsC1C;;;;GAIG;AACH;IAMQ,kBAAoB;I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M,GACJ,MAAM,CAQlB;CACJ;AAED;;;GAGG;AACH;IACI;;;;;;;OAOG;IACH,mBANW,MAAM,0CAGd;QAAyB,YAAY,GAA7B,MAAM;QACW,kBAAkB,GAAnC,MAAM;KAChB,EAgBA;IAHG,cAAkB;IAClB,qBAAgC;IAChC,2BAA4C;CAEnD;AAED;;;GAGG;AACH;IACI;;;;;;OAMG;IACH,mBALW,MAAM,0CAEd;QAAyB,YAAY,GAA7B,MAAM;QACW,kBAAkB,GAAnC,MAAM;KAChB,EAYA;IAFG,cAAgD;IAChD,qBAAgC;CAEvC;uBAhtBsB,oBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature_extraction_audio_spectrogram_transformer.d.ts","sourceRoot":"","sources":["../../../src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js"],"names":[],"mappings":"AAKA;IAEI,yBA2BC;IARG,wBAA8B;IAE9B,sCAEE;IAEF,UAA4B;IAC5B,SAA0B;IAG9B;;;;;OAKG;IACH,kCAJW,YAAY,GAAC,YAAY,cACzB,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAwB3B;IAGD;;;;OAIG;IACH,aAHW,YAAY,GAAC,YAAY,GACvB,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC,CAkB7C;CACJ;iCAzFuD,wCAAwC;uBACzE,uBAAuB"}
1
+ {"version":3,"file":"feature_extraction_audio_spectrogram_transformer.d.ts","sourceRoot":"","sources":["../../../src/models/audio_spectrogram_transformer/feature_extraction_audio_spectrogram_transformer.js"],"names":[],"mappings":"AAKA;IAEI,yBAsBC;IARG,wBAA8B;IAE9B,sCAEE;IAEF,UAA4B;IAC5B,SAA0B;IAG9B;;;;;OAKG;IACH,kCAJW,YAAY,GAAC,YAAY,cACzB,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CAwB3B;IAGD;;;;OAIG;IACH,aAHW,YAAY,GAAC,YAAY,GACvB,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC,CAkB7C;CACJ;iCApFuD,wCAAwC;uBACzE,uBAAuB"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature_extraction_seamless_m4t.d.ts","sourceRoot":"","sources":["../../../src/models/seamless_m4t/feature_extraction_seamless_m4t.js"],"names":[],"mappings":"AAIA;IAEI,yBAwBC;IALG,wBAA8B;IAE9B,sCAEE;IAGN;;;;;OAKG;IACH,kCAJW,YAAY,GAAC,YAAY,cACzB,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CA6B3B;IAED;;;;;;;;;OASG;IACH,aARW,YAAY,GAAC,YAAY,uFAEjC;QAA0B,OAAO,GAAzB,OAAO;QACU,kBAAkB,GAAnC,MAAM;QACY,yBAAyB,GAA3C,OAAO;QACW,qBAAqB,GAAvC,OAAO;KACf,GAAU,OAAO,CAAC;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAuGxE;CACJ;iCAnLuD,wCAAwC;uBACzE,uBAAuB"}
1
+ {"version":3,"file":"feature_extraction_seamless_m4t.d.ts","sourceRoot":"","sources":["../../../src/models/seamless_m4t/feature_extraction_seamless_m4t.js"],"names":[],"mappings":"AAIA;IAEI,yBAmBC;IALG,wBAA8B;IAE9B,sCAEE;IAGN;;;;;OAKG;IACH,kCAJW,YAAY,GAAC,YAAY,cACzB,MAAM,GACJ,OAAO,CAAC,MAAM,CAAC,CA6B3B;IAED;;;;;;;;;OASG;IACH,aARW,YAAY,GAAC,YAAY,uFAEjC;QAA0B,OAAO,GAAzB,OAAO;QACU,kBAAkB,GAAnC,MAAM;QACY,yBAAyB,GAA3C,OAAO;QACW,qBAAqB,GAAvC,OAAO;KACf,GAAU,OAAO,CAAC;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAuGxE;CACJ;iCA9KuD,wCAAwC;uBACzE,uBAAuB"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature_extraction_wespeaker.d.ts","sourceRoot":"","sources":["../../../src/models/wespeaker/feature_extraction_wespeaker.js"],"names":[],"mappings":"AAKA;IAEI,yBAyBC;IANG,wBAA8B;IAE9B,sCAEE;IACF,oBAAgD;IAGpD;;;;OAIG;IACH,kCAHW,YAAY,GAAC,YAAY,GACvB,OAAO,CAAC,MAAM,CAAC,CA2B3B;IAGD;;;;OAIG;IACH,aAHW,YAAY,GAAC,YAAY,GACvB,OAAO,CAAC;QAAE,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC,CA4B/C;CACJ;iCAnGuD,wCAAwC;uBACzE,uBAAuB"}
1
+ {"version":3,"file":"feature_extraction_wespeaker.d.ts","sourceRoot":"","sources":["../../../src/models/wespeaker/feature_extraction_wespeaker.js"],"names":[],"mappings":"AAKA;IAEI,yBAoBC;IANG,wBAA8B;IAE9B,sCAEE;IACF,oBAAgD;IAGpD;;;;OAIG;IACH,kCAHW,YAAY,GAAC,YAAY,GACvB,OAAO,CAAC,MAAM,CAAC,CA2B3B;IAGD;;;;OAIG;IACH,aAHW,YAAY,GAAC,YAAY,GACvB,OAAO,CAAC;QAAE,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC,CA4B/C;CACJ;iCA9FuD,wCAAwC;uBACzE,uBAAuB"}