Skip to content

Commit fc2847c

Browse files
authored
[version] Update to 3.6.1
* Update canvas context type * [version] Update to 3.6.1
1 parent 0188c31 commit fc2847c

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ npm i @huggingface/transformers
4747
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:
4848
```html
4949
<script type="module">
50-
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.6.0';
50+
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.6.1';
5151
</script>
5252
```
5353

@@ -155,7 +155,7 @@ Check out the Transformers.js [template](https://huggingface.co/new-space?templa
155155

156156

157157

158-
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:
158+
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:
159159

160160
### Settings
161161

docs/snippets/2_installation.snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ npm i @huggingface/transformers
77
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:
88
```html
99
<script type="module">
10-
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.6.0';
10+
import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/transformers@3.6.1';
1111
</script>
1212
```

docs/snippets/4_custom-usage.snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
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:
3+
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:
44

55
### Settings
66

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@huggingface/transformers",
3-
"version": "3.6.0",
3+
"version": "3.6.1",
44
"description": "State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!",
55
"main": "./src/transformers.js",
66
"types": "./types/transformers.d.ts",

src/env.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import fs from 'node:fs';
2626
import path from 'node:path';
2727
import url from 'node:url';
2828

29-
const VERSION = '3.6.0';
29+
const VERSION = '3.6.1';
3030

3131
// Check if various APIs are available (depends on environment)
3232
const IS_BROWSER_ENV = typeof window !== "undefined" && typeof window.document !== "undefined";

src/utils/image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class RawImage {
142142
throw new Error('fromCanvas() is only supported in browser environments.')
143143
}
144144

145-
const ctx = canvas.getContext('2d');
145+
const ctx = /** @type {CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D} */ (canvas.getContext('2d'));
146146
const data = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
147147
return new RawImage(data, canvas.width, canvas.height, 4);
148148
}

0 commit comments

Comments
 (0)