Commit Graph

53 Commits

Author SHA1 Message Date
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
Joshua Lochner 76d8e0872e [demo] Formatting 2023-05-16 18:32:48 +02:00
Joshua Lochner 0238306652 Update demo site
Moved all this information to the docs: https://huggingface.co/docs/transformers.js/
2023-05-16 18:32:22 +02:00
Joshua Lochner 27e0683e17 [demo] Use `new URL` syntax for web worker URL 2023-05-16 17:49:55 +02:00
Joshua Lochner 434795f0fa Update demo site
Rewrite as a package and use vite for bundling
2023-05-16 15:52:08 +02:00
Joshua Lochner d4cd9ded76 Update .eslintrc.cjs 2023-05-12 03:24:04 +02:00
Joshua Lochner 656015fc6b Add example react application 2023-05-12 01:45:31 +02:00
Joshua Lochner 6899153904 Add sample electron application 2023-04-28 15:57:26 +02:00
Joshua Lochner aa3286020e Fix typo 2023-04-25 21:39:19 +02:00
Joshua Lochner ca7a1012b5 Update .gitignore to only target build directories at root level 2023-04-25 20:48:12 +02:00
Joshua Lochner 6cb5f7266b Update example browser extension README 2023-04-25 20:42:35 +02:00
Joshua Lochner 2651a7b1a0 Fix typo 2023-04-25 20:38:47 +02:00
Joshua Lochner 07f04de441 Add example browser extension project 2023-04-25 20:34:09 +02:00