Skip to content

Releases: huggingface/transformers.js

2.1.1

02 Jun 00:27
Compare
Choose a tag to compare

Minor patch for v2.1.0 to fix an issue with browser caching.

2.1.0

01 Jun 13:18
Compare
Choose a tag to compare

What's new?

Improved feature extraction pipeline for Embeddings

You can now perform feature extraction on models other than sentence-transformers! All you need to do is target a repo (and/or revision) that was exported with --task default. Also be sure to use the correct quantization for your use-case!

Example: Run feature extraction with bert-base-uncased (without pooling/normalization).

let extractor = await pipeline('feature-extraction', 'Xenova/bert-base-uncased', { revision: 'default' });
let result = await extractor('This is a simple test.');
console.log(result);
// Tensor {
//     type: 'float32',
//     data: Float32Array [0.05939924716949463, 0.021655935794115067, ...],
//     dims: [1, 8, 768]
// }

Example: Run feature extraction with bert-base-uncased (with pooling/normalization).

let extractor = await pipeline('feature-extraction', 'Xenova/bert-base-uncased', { revision: 'default' });
let result = await extractor('This is a simple test.', { pooling: 'mean', normalize: true });
console.log(result);
// Tensor {
//     type: 'float32',
//     data: Float32Array [0.03373778983950615, -0.010106077417731285, ...],
//     dims: [1, 768]
// }

Example: Calculating embeddings with sentence-transformers models.

let extractor = await pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2');
let result = await extractor('This is a simple test.', { pooling: 'mean', normalize: true });
console.log(result);
// Tensor {
//     type: 'float32',
//     data: Float32Array [0.09094982594251633, -0.014774246141314507, ...],
//     dims: [1, 384]
// }

This also means you can do things like semantic search directly in JavaScript/Typescript! Check out the Pinecone docs for an example app which uses Transformers.js!

Over 100 Transformers.js models on the hub!

We now have 109 models to choose from! Check them out at https://huggingface.co/models?other=transformers.js! If you'd like to contribute models (exported with Optimum), you can tag them with library_name: "transformers.js"! Let's make ML more web-friendly!

Misc

  • Fixed various quantization/exporting issues

Full Changelog: 2.0.2...2.1.0

2.0.2

29 May 11:05
Compare
Choose a tag to compare

Fixes issues stemming from ORT's recent release of a buggy version 1.15.0 🙄 (https://www.npmjs.com/package/onnxruntime-web)

Also freezes examples and updates links to use the latest stable wasm files.

2.0.1

20 May 14:17
Compare
Choose a tag to compare

Minor bug fixes

  • BERT Tokenization for strings with numbers
  • Demo site for token-classification (#116)

NPM package

  • Update keywords

2.0.0

17 May 17:48
Compare
Choose a tag to compare

Transformers.js v2.0.0

It's finally here! 🔥

Run Hugging Face transformers directly in your browser, with no need for a server!

GitHub: https://github.com/xenova/transformers.js
Demo site: https://xenova.github.io/transformers.js/
Documentation: https://huggingface.co/docs/transformers.js

Main features:

🛠️ Complete ES6 rewrite
📄 Documentation and examples
🤗 Improved Hugging Face Hub integration
🖥️ Server-side model caching (in Node.js)

Dev-related features:

🧪 Improved testing framework w/ Jest
⚙️ CI/CD with GitHub actions

2.0.0-alpha.4

16 May 22:46
Compare
Choose a tag to compare
2.0.0-alpha.4 Pre-release
Pre-release

Pre-release for Transformers.js v2.0.0

Same as https://github.com/xenova/transformers.js/releases/tag/2.0.0-alpha.3 with various improvements, including:

2.0.0-alpha.3

16 May 06:16
Compare
Choose a tag to compare
2.0.0-alpha.3 Pre-release
Pre-release

Pre-release for Transformers.js v2.0.0

Same as https://github.com/xenova/transformers.js/releases/tag/2.0.0-alpha.2 but with added allowLocalModels setting and improved handling of errors (e.g., CORS errors).

2.0.0-alpha.2

15 May 18:12
Compare
Choose a tag to compare
2.0.0-alpha.2 Pre-release
Pre-release

Pre-release for Transformers.js v2.0.0

Same as https://github.com/xenova/transformers.js/releases/tag/2.0.0-alpha.1 but with updated jsdelivr entry point in package.json

2.0.0-alpha.1

15 May 18:00
Compare
Choose a tag to compare
2.0.0-alpha.1 Pre-release
Pre-release

Pre-release for Transformers.js v2.0.0

Same as https://github.com/xenova/transformers.js/releases/tag/2.0.0-alpha.0 but with CDN-specific entry points in package.json

2.0.0-alpha.0

15 May 15:30
Compare
Choose a tag to compare
2.0.0-alpha.0 Pre-release
Pre-release

Pre-release for Transformers.js v2.0.0

Major changes

  • Complete ES6 rewrite
  • Documentation live at https://huggingface.co/docs/transformers.js
  • Overhauled testing framework (now using Jest)
  • Improve hub integration (now you can simply pass model ids to pipeline, AutoModel, AutoTokenizer, and AutoProcessor.)
  • Node.js model caching (#62)

Minor changes