diff --git a/README.md b/README.md index 1a3efe52c..8e5d781a6 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ npm i @huggingface/transformers Alternatively, you can use it in vanilla JS, without any bundler, by using a CDN or static hosting. For example, using [ES Modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), you can import the library with: ```html ``` @@ -155,7 +155,7 @@ Check out the Transformers.js [template](https://huggingface.co/new-space?templa -By default, Transformers.js uses [hosted pretrained models](https://huggingface.co/models?library=transformers.js) and [precompiled WASM binaries](https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.6.0/dist/), which should work out-of-the-box. You can customize this as follows: +By default, Transformers.js uses [hosted pretrained models](https://huggingface.co/models?library=transformers.js) and [precompiled WASM binaries](https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.6.1/dist/), which should work out-of-the-box. You can customize this as follows: ### Settings diff --git a/docs/snippets/2_installation.snippet b/docs/snippets/2_installation.snippet index eb126856c..ae5047699 100644 --- a/docs/snippets/2_installation.snippet +++ b/docs/snippets/2_installation.snippet @@ -7,6 +7,6 @@ npm i @huggingface/transformers Alternatively, you can use it in vanilla JS, without any bundler, by using a CDN or static hosting. For example, using [ES Modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), you can import the library with: ```html ``` diff --git a/docs/snippets/4_custom-usage.snippet b/docs/snippets/4_custom-usage.snippet index 4feb4cf4b..d0130b2bc 100644 --- a/docs/snippets/4_custom-usage.snippet +++ b/docs/snippets/4_custom-usage.snippet @@ -1,6 +1,6 @@ -By default, Transformers.js uses [hosted pretrained models](https://huggingface.co/models?library=transformers.js) and [precompiled WASM binaries](https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.6.0/dist/), which should work out-of-the-box. You can customize this as follows: +By default, Transformers.js uses [hosted pretrained models](https://huggingface.co/models?library=transformers.js) and [precompiled WASM binaries](https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.6.1/dist/), which should work out-of-the-box. You can customize this as follows: ### Settings diff --git a/package-lock.json b/package-lock.json index 4c2c16155..630b53470 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@huggingface/transformers", - "version": "3.6.0", + "version": "3.6.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@huggingface/transformers", - "version": "3.6.0", + "version": "3.6.1", "license": "Apache-2.0", "dependencies": { "@huggingface/jinja": "^0.4.1", diff --git a/package.json b/package.json index 3584ec2dd..cafa68d87 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@huggingface/transformers", - "version": "3.6.0", + "version": "3.6.1", "description": "State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!", "main": "./src/transformers.js", "types": "./types/transformers.d.ts", diff --git a/src/env.js b/src/env.js index 00ba5859b..d65231da1 100644 --- a/src/env.js +++ b/src/env.js @@ -26,7 +26,7 @@ import fs from 'node:fs'; import path from 'node:path'; import url from 'node:url'; -const VERSION = '3.6.0'; +const VERSION = '3.6.1'; // Check if various APIs are available (depends on environment) const IS_BROWSER_ENV = typeof window !== "undefined" && typeof window.document !== "undefined"; diff --git a/src/utils/image.js b/src/utils/image.js index 9d1bb3606..54db7938f 100644 --- a/src/utils/image.js +++ b/src/utils/image.js @@ -142,7 +142,7 @@ export class RawImage { throw new Error('fromCanvas() is only supported in browser environments.') } - const ctx = canvas.getContext('2d'); + const ctx = /** @type {CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D} */ (canvas.getContext('2d')); const data = ctx.getImageData(0, 0, canvas.width, canvas.height).data; return new RawImage(data, canvas.width, canvas.height, 4); }