Commit Graph

65 Commits

Author SHA1 Message Date
Joshua Lochner bd315529ab
Update tokenizer playground (#717)
* [tokenizer playground] Add Mistral v3 tokenizer

* Add support for custom tokenizers

* Add llama 3 tokenizer
2024-05-10 23:56:28 +02:00
Joshua Lochner aa542cf548
Update dependencies (#704)
* Update dependencies

* Bump protobufjs from 7.2.4 to 7.2.6 in /examples/semantic-image-search (#705)

Bumps [protobufjs](https://github.com/protobufjs/protobuf.js) from 7.2.4 to 7.2.6.
- [Release notes](https://github.com/protobufjs/protobuf.js/releases)
- [Changelog](https://github.com/protobufjs/protobuf.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.2.4...protobufjs-v7.2.6)

---
updated-dependencies:
- dependency-name: protobufjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump protobufjs from 7.2.4 to 7.2.6 in /examples/next-client (#706)

Bumps [protobufjs](https://github.com/protobufjs/protobuf.js) from 7.2.4 to 7.2.6.
- [Release notes](https://github.com/protobufjs/protobuf.js/releases)
- [Changelog](https://github.com/protobufjs/protobuf.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.2.4...protobufjs-v7.2.6)

---
updated-dependencies:
- dependency-name: protobufjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump protobufjs from 7.2.4 to 7.2.6 in /examples/next-server (#707)

Bumps [protobufjs](https://github.com/protobufjs/protobuf.js) from 7.2.4 to 7.2.6.
- [Release notes](https://github.com/protobufjs/protobuf.js/releases)
- [Changelog](https://github.com/protobufjs/protobuf.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.2.4...protobufjs-v7.2.6)

---
updated-dependencies:
- dependency-name: protobufjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump protobufjs in /examples/semantic-image-search-client (#708)

Bumps [protobufjs](https://github.com/protobufjs/protobuf.js) from 7.2.4 to 7.2.6.
- [Release notes](https://github.com/protobufjs/protobuf.js/releases)
- [Changelog](https://github.com/protobufjs/protobuf.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.2.4...protobufjs-v7.2.6)

---
updated-dependencies:
- dependency-name: protobufjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-11 00:24:51 +02:00
Joshua Lochner cdbc532cf6
Update dependencies (#702)
* Bump vite from 4.5.2 to 4.5.3 in /examples/tokenizer-playground (#693)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.2 to 4.5.3.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.3/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.3/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump express from 4.18.2 to 4.19.2 (#666)

Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump vite from 5.0.12 to 5.0.13 in /examples/remove-background-client (#694)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.12 to 5.0.13.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.0.13/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.13/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump vite from 5.0.12 to 5.0.13 in /examples/zero-shot-classification (#695)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.12 to 5.0.13.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.0.13/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.13/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump vite from 5.0.12 to 5.0.13 in /examples/depth-anything-client (#696)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.12 to 5.0.13.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.0.13/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.13/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump vite from 5.0.12 to 5.0.13 in /examples/semantic-audio-search (#697)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.12 to 5.0.13.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.0.13/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.13/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump vite from 4.5.2 to 4.5.3 in /examples/code-completion (#698)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.2 to 4.5.3.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.3/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.3/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump vite from 5.1.4 to 5.1.7 in /examples/video-object-detection (#699)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.1.4 to 5.1.7.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.1.7/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.1.7/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump vite from 5.1.1 to 5.1.7 in /examples/cross-encoder (#700)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.1.1 to 5.1.7.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.1.7/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.1.7/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump vite from 5.1.1 to 5.1.7 in /examples/adaptive-retrieval (#701)

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.1.1 to 5.1.7.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.1.7/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.1.7/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 16:07:58 +02:00
dependabot[bot] 8804c36591
Bump ip from 2.0.0 to 2.0.1 in /examples/electron (#665)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-26 22:45:55 +02:00
Joshua Lochner f0ef2e8eee
Update tokenizer `apply_chat_template` functionality (#647)
* Allow custom kwargs in `tokenizer.apply_chat_template`

* Update jinja dependency version

* Add `tokenizer_kwargs` options

* Add support for dictionaries of chat templates in the tokenizer config

* Add `CohereTokenizer`

* `apply_chat_template` is no longer async

* Add unit test for multiple chat templates

* Update tokenizers.js

* Also update when `chat_template` is undefined

* Support setting tokenizer and text from URL

* Update Claude tokenizer display name

* Add Cohere Command-R tokenizer to playground

* Add `Grok1Tokenizer`

* Throw error if chat template object is malformed

* Improved error checking

* Remove redundant error check

* `template_dict` can be a null-prototype object
2024-03-20 15:22:01 +02:00
Joshua Lochner 382ff3af35
Create cross-encoder demo (#617) 2024-03-06 17:31:57 +02:00
Joshua Lochner d525c8bfd4
Add Claude 3 + Mistral to tokenizer playground 2024-03-05 00:52:12 +02:00
Joshua Lochner ce4fd62202
Update tokenizer playground dependencies (#599)
* Update transformers.js version

* Update Token.jsx
2024-03-05 00:42:37 +02:00
Joshua Lochner 271c6f1744
Create video object detection demo (#607) 2024-02-27 19:35:12 +02:00
Joshua Lochner 68ed7f6cbb
Add Gemma Tokenizer (#598)
* Fix styling for whitespace tokens

* Add `GemmaTokenizer`

* Update minimum `@huggingface/jinja` version

* Add Gemma to tokenizer playground

* Add Gemma tokenizer unit test

* Update tokenizer names in playground

* Update Gemma tokenizer test
2024-02-21 16:22:22 +02:00
Joshua Lochner 6d2808b571
Create adaptive retrieval demo (#587)
* Create adaptive retrieval demo

* Remove waiting label
2024-02-21 15:16:51 +02:00
Joshua Lochner d1eabaeb0b
Update tokenizer playground (#597)
* Update transformers.js version

* Remove unused images

* Remove link to placeholder image
2024-02-21 14:04:11 +02:00
Joshua Lochner 66d59d79d4
Add remove-background demo (#576)
* Add remove-background demo

* Open links in new tab

* Add mention of running locally
2024-02-07 14:31:52 +02:00
dependabot[bot] 9f37036731
Bump vite from 5.0.11 to 5.0.12 in /examples/zero-shot-classification (#548)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.11 to 5.0.12.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.0.12/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.12/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-29 13:45:22 +02:00
Joshua Lochner 1edf683e64
Add zero-shot classification demo (#519)
* Create zero-shot-classification demo

* Update hypothesis template
2024-01-29 12:29:33 +02:00
Joshua Lochner 497628ff07
Create depth anything demo (#540) 2024-01-25 17:58:40 +02:00
dependabot[bot] 4fb23f2fd1
Bump vite from 4.5.1 to 4.5.2 in /examples/tokenizer-playground (#538)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.1 to 4.5.2.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.2/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.2/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-25 15:18:54 +02:00
dependabot[bot] 544c2c2f9d
Bump vite from 5.0.6 to 5.0.12 in /examples/semantic-audio-search (#537)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.6 to 5.0.12.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.0.12/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.12/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-25 15:18:29 +02:00
dependabot[bot] 9d7fb85167
Bump vite from 4.5.1 to 4.5.2 in /examples/code-completion (#536)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.1 to 4.5.2.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.2/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.2/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-25 15:18:18 +02:00
Joshua Lochner 935274fd3f
Add SAM demo (#513) 2024-01-11 02:10:38 +02:00
Lian LF 4112429d38
Update Next.js Dockerfile HOSTNAME (#461)
See https://github.com/vercel/next.js/pull/54342 and https://github.com/vercel/next.js/issues/54093
2023-12-20 01:53:45 +02:00
Joshua Lochner 8e49e5e638
Create CLAP demo (#442) 2023-12-08 19:43:10 +02:00
Joshua Lochner ceb75dccf9
Update vite version for example applications (#435) 2023-12-06 18:33:15 +02:00
Joshua Lochner 6fc268cb23
Update sharp dependency version (#400) 2023-11-18 12:58:21 +02:00
Joshua Lochner 4a991bd911
Add support for `text-to-speech` (w/ Speecht5) (#345)
* Add vocoder to export

* Add tokenizer.json export for speecht5 models

* Update speecht5 supported models

* Create `SpeechT5Tokenizer`

* Add `ones` and `ones_like` tensor functions

* Add support for speecht5 text-to-speech

* Disambiguate `SpeechSeq2Seq` and `Seq2SeqLM`

* Create `TextToAudioPipeline`

* Add listed support for `text-to-audio` / `text-to-speech`

* Use unquantized vocoder by default

* Skip speecht5 unit tests for now

Due to bug in transformers: https://github.com/huggingface/transformers/issues/26547

* Update example pipeline output

* Create simple in-browser TTS demo

* Add template README

* Delete package-lock.json

* Update required transformers.js version

* Add link to Transformers.js

* Double -> Single quotes

* Add link to text-to-speech demo

* Update sample speaker embeddings
2023-10-23 16:31:46 +02:00
Joshua Lochner 983cf3a246 Update example app dependencies 2023-10-22 10:36:23 +02:00
Joshua Lochner 63b4369ccc
Update example app dependencies (#347)
* Update dependency versions

* Update dev dependency versions
2023-10-22 10:26:00 +02:00
Joshua Lochner a45b8441d3
Improve electron example template (#342)
* Update transformers.js version

* Use Singleton object in electron tutorial

* Create package-lock.json

* Remove models folder

* Remove step for copying models to local folder
2023-10-04 17:45:25 +02:00
Joshua Lochner dac6f4b073
Improve example browser extension template (#325)
Removes unnecessary complexity
2023-09-23 03:34:10 +02:00
Joshua Lochner 982498c064
Create in-browser version of `semantic-image-search` example app (#326)
* Create in-browser version of `semantic-image-search`

* Add loading model and database message

* Create README.md

* Add link to example app
2023-09-23 02:54:28 +02:00
Per Harald Borgen ef27100553
Add JavaScript tutorial to the docs (#271) 2023-09-17 21:47:09 +02:00
Joshua Lochner 9a3339239e
New models and refactoring (#276)
* Add `CodeLlamaTokenizer`

* Add `codellama` for testing

* Update default quantization settings

* Refactor `PretrainedModel`

* Remove unnecessary error message

* Update llama-code-tokenizer test

* Add support for `GPTNeoX` models

* Fix `GPTNeoXPreTrainedModel` config

* Add support for `GPTJ` models

* Add support for `WavLM` models

* Update list of supported models

- CodeLlama
- GPT NeoX
- GPT-J
- WavLM

* Add support for XLM models

* Add support for `ResNet` models

* Add support for `BeiT` models

* Fix casing of `BeitModel`

* Remove duplicate code

* Update variable name

* Remove `ts-ignore`

* Remove unnecessary duplication

* Update demo model sizes

* [demo] Update default summarization parameters

* Update default quantization parameters for new models

* Remove duplication in mapping

* Update list of supported marian models

* Add support for `CamemBERT` models

* Add support for `MBart` models

* Add support for `OPT` models

* Add `MBartTokenizer` and `MBart50Tokenizer`

* Add example of multilingual translation with MBart models

* Add `CamembertTokenizer`

* Add support for `HerBERT` models

* Add support for `XLMTokenizer`

* Fix `fuse_unk` config

* Do not remove duplicate keys for `Unigram` models

See https://huggingface.co/camembert-base for an example of a Unigram tokenizer that has two tokens with the same value (`<unk>`)

* Update HerBERT supported model text

* Update generate_tests.py

* Update list of supported models

* Use enum object instead of classes for model types

Fixes https://github.com/xenova/transformers.js/issues/283

* Add link to issue

* Update dependencies for unit tests

* Add `sentencepiece` as a testing requirement

* Add `protobuf` to test dependency

* Remove duplicated models to test
2023-09-08 15:17:05 +02:00
Joshua Lochner 9c449c151c
Fix caching for LFS files from the Hugging Face Hub (#251)
* Fix model caching for LFS files from the HF Hub

* Ignore local model check on demo site
2023-08-22 18:28:37 +02:00
Joshua Lochner d479953a62
[WIP] Add MMS and Wav2Vec2 models (Closes #209) (#220)
* Add example `wav2vec2` models

* Add support for `CTCDecoder` and `Wav2Vec2CTCTokenizer`

* Generate tokenizer.json files for wav2vec2 models

* Fix wav2vec2 custom tokenizer generation

* Implement wav2vec2 audio-speech-recognition

* Add `Wav2Vec2` as a supported architecture

* Update README.md

* Update generate_tests.py

* Ignore invalid tests

* Update supported wav2vec2 models

* Update supported_models.py

* Simplify pipeline construction

* Implement basic audio classification pipeline

* Update default topk value for audio classification pipeline

* Add example usage for the audio classification pipeline

* Move `loadAudio` to utils file

* Add audio classification unit test

* Add wav2vec2 ASR unit test

* Improve generated wav2vec2 tokenizer json

* Update supported_models.py

* Allow `added_tokens_regex` to be null

* Support exporting mms vocabs

* Supported nested vocabularies

* Update supported tasks and models

* Add warnings to ignore language and task for wav2vec2 models

Will add in future

* Mark internal methods as private

* Add typing to audio variable

* Update node-audio-processing.mdx

* Move node-audio-processing to guides

* Update table of contents

* Add example code for performing feature extraction w/ `Wav2Vec2Model`

NOTE: feature extraction of MMS models is currently broken in the python library, but it works correctly here. See
https://github.com/huggingface/transformers/issues/25485 for more info

* Refactor `Pipeline` class params

* Fix `pipeline` function

* Fix typo in `pipeline` JSDoc

* Fix second typo
2023-08-14 22:18:44 +02:00
Joshua Lochner db7d0f0f83
Tokenization improvements (#234)
* Create basic tokenizer playground app

* Default to no display when user adding large body of text

* Optimize BPE algorithm

- Use map instead of object for `bpe_ranks`
- Replace reduction in BPE algorithm with for loop
- Avoid conversions between sets and arrays

* Use for loop to avoid stack issues with `.push(...items)`

* Fix `mergeArrays` typing

* Remove unnecessary try-catch block in BPE

* Add Llama, T5, and BERT tokenizers to the playground

* Improve how BERT/T5 tokens are displayed

* Improve how token margins are displayed

* Use `Map` for cache

* Add efficient heap-based priority queue implementation

* Add more unit tests for LlamaTokenizer

Selected from https://github.com/belladoreai/llama-tokenizer-js/blob/master/llama-tokenizer.js#L381-L452

* Implement priority-queue-based BPE algorithm

* Remove old code

* Update `bpe` docstring

* Add `data-structures` page to docs

* Update JSDoc for data-structures.js

* Update data-structures.js

* Move `TokenLattice` and `CharTrie` to data-structures module

* Minor refactoring
2023-08-08 12:11:35 +02:00
Joshua Lochner a9a955c76f Update .env.local.example 2023-08-01 18:55:46 +02:00
Joshua Lochner 99db37864d Update semantic image search example README 2023-08-01 18:55:41 +02:00
Joshua Lochner b1537e28dc Create package-lock.json 2023-08-01 15:30:52 +02:00
Joshua Lochner f867226c7e
Improve browser extension sample/template (#196)
* Update extension to be module

* Update example extension

* Allow user to specify a custom cache system

* Implement custom cache system

Emulates the Web Cache API using chrome's local storage API

* Use custom cache system in extension

* Fix serialization

* Remove old folders

* Update extension readme

* Add note about JSON requirement for local storage
2023-08-01 14:23:21 +02:00
Joshua Lochner 2fde656791
Add support for computing CLIP image and text embeddings separately (Closes #148) (#227)
* Define custom CLIP ONNX configs

* Update conversion script

* Support specifying custom model file name

* Use int64 for CLIP input ids

* Add support for CLIP text and vision models

* Fix JSDoc

* Add docs for `CLIPTextModelWithProjection`

* Add docs for `CLIPVisionModelWithProjection`

* Add unit test for CLIP text models

* Add unit test for CLIP vision models

* Set resize precision to 3 decimal places

* Fix `RawImage.save()` function

* Throw error when reading image and status != 200

* Create basic semantic image search application

* Separate out components

* Add `update-database` script

* Update transformers.js version
2023-08-01 14:01:04 +02:00
Joshua Lochner 2015c685c7
Add Starcoder model support + demo (#225)
* Add support for `gpt_bigcode` models

* Create basic code-completion sample application

* Update sidebar

* Remove debug statement

* Disable 1B model (for now)

* Display progress bars

* Reuse config if not specified

* Update supported_models.py

* Update comment

* Add temperature/sample/topk generation params

* Update sidebar

* Add `gpt_bigcode` to supported models list

* Add code playground example

* Update title

* Cleanup

* Ignore `bigcode/starcoderbase-1b` from tests

* Update transformers.js version for demo
2023-07-28 13:24:32 +02:00
Joshua Lochner 09ff83b90e
Create example next.js application (Closes #210) (#211)
* Create example next app

* Link to example app

* Update next configs

* Create tutorial for next.js application

* Update next.js tutorial

* Rename project `next` -> `next-client`

* Clone `next-server` from `next-client`

* Update next.config.js for server-side inference

* Create basic server-side next.js application

* Update example links

* Update subheading for client-side next.js app

* Update next.config.js files

* Create example Dockerfile

* Update next tutorial to include server-side inference

* Improve wording

* Update Dockerfile

* Add step to create a Dockerfile

* Update examples snippet

* Fix wording
2023-07-26 01:48:13 +02:00
Joshua Lochner 2e812458e4 Fix object-detection demo 2023-07-11 16:07:01 +02:00
Joshua Lochner 1bf7958cfa
Add example code for running text-generation models (#175)
* Add example code for running text-generation models

* Fix non-greedy sampling functions

* Update samplers

* Remove duplicate requirement

`onnxruntime` is specified in `optimum[onnxruntime]`

* Align `generate` function output with python library

Include starting tokens in output

* [docs] Add example text-generation code

* Update demo site text streaming for causal language models

* Override default code highlighting for operators

* Fix order of link
2023-07-01 03:04:00 +02:00
Joshua Lochner 27d7ea489b
Improvements to documentation (#172)
* link to the conversion Space for maximum simplicity

* add some types to script (very optional)

* typo

* no need for trailing slash here

* Node is also a valid option

* Document how to find a compatible checkpoint on the hub

* Update README

* Fix typing

* Update docs index

---------

Co-authored-by: Julien Chaumond <julien@huggingface.co>
2023-06-29 19:32:17 +02:00
Joshua Lochner 573012b434
[docs] Add tutorial + example app for server-side whisper (#147)
* Update typo in node tutorial

* Create node audio processing tutorial

* Point to tutorial in `read_audio` function

* Rename `.md` to `.mdx`

* Add node audio processing tutorial to table of contents

* Add link to model in tutorial

* Update error message grammar
2023-06-20 23:10:33 +02:00
Joshua Lochner d107ccb51e [demo] Update model sizes 2023-05-31 18:42:14 +02:00
Joshua Lochner 4a6b8ccc41 [demo] Fix token-classification (Closes #116) 2023-05-19 08:04:45 +02:00
Joshua Lochner 75ec68ed8b Create example Node.js application 2023-05-17 12:34:48 +02:00
Joshua Lochner 0b403ce8e4 Set base path for demo site from environment variable if present 2023-05-16 19:10:02 +02:00