Commit Graph

1021 Commits

Author SHA1 Message Date
Joshua Lochner 41f98b761f [version] Update to 2.15.0 2024-02-06 15:06:50 +02:00
Joshua Lochner dbeb314323
Update `jsdoc-to-markdown` dev dependency (#574) 2024-02-06 14:59:51 +02:00
Joshua Lochner 2bd8c78aec
Support `size_divisbility` after resizing (#569) 2024-02-06 13:10:12 +02:00
Joshua Lochner ae7af0a6c2
Add support for Qwen2 models (#570)
* Add support for `Qwen2Tokenizer`

* Add qwen-specific tokenizer unit test

* Add support for qwen2 models

* Fix typo
2024-02-06 12:44:30 +02:00
Joshua Lochner a6f3f88231
Improve unknown model warnings (#554)
Warn with model type if known
2024-02-05 17:35:49 +02:00
Joshua Lochner 2b3dcb1863
Use absolute links for example code (#550) 2024-02-01 17:00:56 +02:00
Joshua Lochner 9f877eea95 [version] Update to 2.14.2 2024-01-29 14:02:11 +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 b1f96a2fc9
Add support for wav2vec2-bert (#544)
* Add povey window function

* Add `SeamlessM4TFeatureExtractor`

* Add support for wav2vec2-bert models

* Add `SeamlessM4TFeatureExtractor` processor unit tests

* Add pipeline support for `wav2vec2-bert` models

* Update JSDoc
2024-01-27 17:50:03 +02:00
Joshua Lochner 03f2763a27
Add whitespace pretokenizer (#542)
* Add `WhitespacePreTokenizer`

* Add unit test for `Whitespace` pretokenizer
2024-01-27 15:13:20 +02:00
Joshua Lochner 497628ff07
Create depth anything demo (#540) 2024-01-25 17:58:40 +02:00
Joshua Lochner a2fcd110a3 [version] Update to 2.14.1 2024-01-25 15:26:57 +02:00
Joshua Lochner 587adfc193
Add support for Depth Anything (#534)
* Add support for `DPTImageProcessor`

* Add support for depth anything model

* Update list of `depth_anything` models

* Update processor test model id
2024-01-25 15:21:51 +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 4a6addab69
Return empty tokens array if text is empty after normalization (#535) 2024-01-25 14:40:56 +02:00
Joshua Lochner b07336d8f7
Fix typo in tokenizers.js (#518) 2024-01-14 20:39:48 +02:00
Joshua Lochner 935274fd3f
Add SAM demo (#513) 2024-01-11 02:10:38 +02:00
Joshua Lochner 5b5aa4cf6a [version] Update to 2.14.0 2024-01-10 18:30:36 +02:00
dependabot[bot] 3339ed1221
Bump follow-redirects from 1.15.2 to 1.15.4 (#511)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.2 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.2...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-10 18:18:39 +02:00
Joshua Lochner cdcbfc125c
Add support for Segment Anything Model (#510)
* Update SamModel

* Make `AutoModel.from_pretrained` work with SamModel

* Add listed support for SAM (Segment Anything Model)

* Update types of `calculateDimensions`

* Throw error if reading image from tensor with dims.length != 3

* Make SamProcessor input points optional

* Fix type errors

* `let` -> `const`

* `cat` -> `stack`

* Expose `reshape_input_points` in `SamProcessor`

* Add `input_labels` input parameter for SAM

* Add `input_labels` to sam processor

* Update SAM unit tests

* Remove TODOs

* Update JSDoc
2024-01-10 17:47:21 +02:00
Joshua Lochner 4d1d4d3346
Add support for processing non-square images w/ `ConvNextFeatureExtractor` (#503)
* Abstract resize function

* Fix tolerance comparison

* Update `ConvNextFeatureExtractor`

* Update ConvNext unit test
2024-01-10 17:04:21 +02:00
Joshua Lochner f6555dc321
Encode revision in remote URL (#507)
Required to support accessing PRs on the HF Hub
2024-01-10 17:03:57 +02:00
Joshua Lochner 07df34ff33 [version] Update to 2.13.4 2024-01-04 19:08:32 +02:00
Joshua Lochner ebd533531a
Add support for cross-encoder models (+fix token type ids) (#501)
* Formatting

* Update ESM pair template

* Fix token type ids

* Update JSDoc

* Cleanup

* Remove unused `prepare_model_inputs` function

* Move pad and truncate logic to helper functions

* Add static padding/truncation unit tests

* Fix padding/truncation

* Remove unused `add_token_types` function

* Reduce duplication

* `let` -> `const` where possible

* Add cross-encoder models
2024-01-04 18:37:26 +02:00
Joshua Lochner f3482baa51 [version] Update to 2.13.3 2024-01-04 02:14:10 +02:00
Joshua Lochner e2259b95f7
Fix properties on pipelines (#500)
* Remove redundant any conversion

* Update pipeline types

* Remove unnecessary `self` declarations

* Update logits data type
2024-01-04 01:21:03 +02:00
Joshua Lochner 5da0297642
Fix typo (#498) 2024-01-03 20:37:08 +02:00
Joshua Lochner 733f98277d [version] Update to 2.13.2 2024-01-03 16:41:35 +02:00
Joshua Lochner d50ebfdb05
Improved intellisense (#496)
* Define new types for pipeline options

* Make ZeroShotImageClassificationPipelineOptions optional

* Make options optional
2024-01-03 16:39:13 +02:00
Joshua Lochner e8d1236c11 [version] Update to 2.13.1 2024-01-03 12:59:13 +02:00
Joshua Lochner 81f1e5c320
Add `phi-1_5` model (#493)
NOTE: Currently only works with node.js backend
2024-01-02 23:12:09 +02:00
Joshua Lochner 38ec1d41b3
Improve typing of `pipeline` helper function (#485)
* Improve typing of `pipeline` helper function

* Overhaul image pipeline types

* Improve typing

* Fix export

* Do not require separate proxy object

* Update text classification pipeline types

* Fix calls to base pipeline

* Improve inheritance

* Fix JSDoc

* Update token classification pipeline typing

* Update question answering pipeline

* Update fill-mask pipeline

* Fix JSDoc

* Improve generation config typing

* Update text2text generation pipeline

* Fix generation config type

* Update summarization and translation pipelines

* Update text generation pipeline types

* Update zero-shot classification pipeline types

* Update feature extraction pipeline types

* Update audio pipeline types

* Fix generation config types

* Improve pipeline constructor types

* Update image to text pipeline types

* Update image classification pipeline types

* Update zero-shot image classification pipeline types

* Update ImageSegmentationPipeline constructor type

* Update object detection pipeline types

* Update zero-shot object detection pipeline types

* Update document question answering pipeline types

* Update text-to-audio pipeline types

* Update image-to-image pipeline types

* Update depth estimation pipeline types

* Improve return JSDoc

* Improve example pipeline JSDoc
2024-01-02 17:08:46 +02:00
Joshua Lochner 61459e38d8 [version] Update to 2.13.0 2023-12-27 16:27:51 +02:00
Joshua Lochner e2d17b946f
Add support for SigLIP models (#473)
* Add support for SigLIP models

* Skip siglip tokenizer tests

* Move SigLIP-specific zero-shot-image-classification logic to pipeline
2023-12-27 15:49:33 +02:00
Joshua Lochner 9b84d7b4da
Add support for CLIPSeg models (#478)
* Add support for CLIPSeg models

* Update JSDoc
2023-12-27 15:40:17 +02:00
Joshua Lochner 80af1c49bb
Add support for Segformer (#480)
* Add support for Segformer

* Add semantic segmentation unit test

* Update pipelines.test.js
2023-12-27 15:12:07 +02:00
Joshua Lochner 1394f73107
Add support for VITS (multilingual TTS) (#466)
* Add custom VITS tokenizer converter

* Do not decode if expected input_ids is empty

* Update vits tokenizer tests

* Implement `VitsTokenizer`

* Add support for VITS model

* Support VITS through pipeline API

* Update JSDoc

* Add TTS unit test

* Add speecht5 unit test

* Fix typo

* Fix typo

* Update speecht5 model id

* Add note about using quantized speecht5 in unit tests

* Monkey-patch `BigInt64Array` and `BigUint64Array`
2023-12-26 16:34:52 +02:00
Joshua Lochner f5bc758c49
Add support for Table Transformer model (#477) 2023-12-26 15:53:08 +02:00
Joshua Lochner 44b62ed5d4
Add support for DiT models (#474) 2023-12-26 15:51:15 +02:00
Joshua Lochner c91248cf70
Add support for RoFormer models (#464)
* Add `RoFormerTokenizer

* Use `clean_text` in bert normalizer config

* Add control characters test

* Add support for RoFormer models

* Use default label if id2label is not specified

* Update requirements.txt

* Skip roformer tokenizer tests
2023-12-26 15:49:11 +02:00
Joshua Lochner 7636a1c416
Add spaces template link to README (#467) 2023-12-23 19:58:00 +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 0bf6e6712f [version] Update to 2.12.1 2023-12-18 23:25:00 +02:00
Joshua Lochner 1427125dc3
Update jinja dependency (#459)
* Make `@huggingface/jinja` a dependency

* Update package-lock.json

* Update JSDoc
2023-12-18 23:22:24 +02:00
Joshua Lochner 61cb4f5c3a
Include `@huggingface/jinja` in exported webpack build (#458)
In future, probably a better idea to dynamically import. However, currently it affects importing from CDNs.
2023-12-18 20:23:40 +02:00
Joshua Lochner 81aab022ff [version] Update to 2.12.0 2023-12-18 17:04:41 +02:00
Joshua Lochner d4f7cd5024
Add support for chat templates (#408)
* Add basic support for chat templates

* Cleanup

* JSDoc improvements

* Support conversion of user-defined functions

* Cleanup

* Fix function creation

* Add unit tests for templates

* Cleanup

* Improve JSDoc

* Add missing return types

* Add chat templates docs to table of contents

* Add support for logical negation

* Fix nested logical negation

* Add unit tests for logical operators

* Add loop variables

* Add support for `RuntimeValue` built-in functions

* Add unit tests for string instance methods

* Fix conversion of normal function to `FunctionValue`

* Update object method unit tests

* Save chat template to tokenizer_config.json during conversion

* Fix `raise_exception` error

* Add `!=` operator for booleans

* Remember to increment loop index

* Cleanup for loop evaluator

* Use `is` helper function

* Add support for text nodes

i.e., non Jinja statements/expressions

* Add auto-generated templating tests

* Update unit tests

* Remove unused function

* Add default chat templates

* Use repo with up-to-date tokenizer config

* Temporarily disable zephyr test

* Delete templates.test.js

* Move Jinja functionality to `@huggingface/jinja`

* Fix template cache type

* Update chat template unit tests

* Update `@huggingface/jinja` version

* Fix default llama2 system prompt usage

* Add unit test for llama2 w/o chat template set

* Update jinja version

* Update jinja version

* Add unit test for user-defined chat templates

Example from https://discuss.huggingface.co/t/issue-with-llama-2-chat-template-and-out-of-date-documentation/61645/3

* Add `AddedToken` for improved tokenization

* Add example usage for chat templates

* Add 'first' Metaspace pretokenizer prepend scheme

* Formatting

* Update wav2vec2 converter special tokens whitespace split

* Fix Metaspace pretokenizer split criteria

* Update inputs of `PreTokenizerSequence`

* Improve Metaspace pretokenizer

* Update llama tokenizer tests

* Improve handling of legacy llama tokenizer

* Re-enable SPM tests

* Add static tokenizer test cases

* Add llama2 static tests

* Allow user to override legacy tokenizer behaviour in `.from_pretrained`

* Add legacy tokenizer unit tests

* Bump jinja version to 0.1.0
2023-12-18 17:00:50 +02:00