Commit Graph

1052 Commits

Author SHA1 Message Date
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
Joshua Lochner 6129e45b2b [version] Update to 2.11.0 2023-12-13 15:19:12 +02:00
Joshua Lochner 2de085b6e5
Add support for ChineseCLIP models (#455)
* Update `VitMatteImageProcessor` test comment

* Add support for ChineseCLIP models

* Add chinese-clip to list of supported models

* Sort zero-shot-image-classification results by score (desc)

* Update expected zero-shot image classification output
2023-12-13 14:47:17 +02:00
Joshua Lochner b978ff8ce4
Add support for ViTMatte models (#448)
* Add support for `VitMatte` models

* Add `VitMatteImageProcessor`

* Add `VitMatteImageProcessor` unit test

* Fix typo

* Add example code for `VitMatteForImageMatting`

* Fix JSDoc

* Fix typo
2023-12-13 02:18:36 +02:00
Joshua Lochner 80d22dae7b
Add support for ESM models (#447)
* Add support for ESM models

* Add ESM tokenizer conversion methods

* Add special test cases for ESM tokenizer

* add special tokens in conversion script

* Do not save decoder

* Add special tokens tokenizer test

* Join tokens with space if decoder is null

* Treat all tokens as added tokens

* Use `WhitespaceSplit` pretokenizer

* `<eos>` and `<bos>` are not special tokens

* Update more supported ESM models

* Add `--tokenizer_id` to conversion script

* Add supported models comments
2023-12-13 02:10:27 +02:00
Joshua Lochner 0d2f05def5
Add support for ELECTRA models (#446) 2023-12-12 18:56:36 +02:00
Joshua Lochner 0ffdc8d9ca
Add support for Hubert models (#449) 2023-12-12 18:32:16 +02:00
Joshua Lochner 47b1a873a2
Add support for ConvBERT models (#445)
* Add support for `ConvBERT` models

* Fix `ConvBertTokenizer`

* Fix tokenizer
2023-12-12 17:54:27 +02:00
Joshua Lochner 9308f880c5
Add support for DINOv2 models (#444)
* Add dinov2 models

* Add `BitImageProcessor`

* Update list of supported models
2023-12-12 17:42:48 +02:00
Joshua Lochner 09c760e817
Add support for Phi models (#443) 2023-12-12 17:18:58 +02:00
Joshua Lochner 8c465a95be
Fix tensor inheritance (#451)
* Do not extend from ONNX tensor (fix #437)

* Fix typing issues

* Typing improvements

* Apply suggestions

* Update tensor import type
2023-12-12 17:17:13 +02:00
Joshua Lochner 2cd2997d57
Add CLS pooling option to `feature-extraction` pipeline (#450) 2023-12-12 00:19:59 +02:00
Joshua Lochner 8e49e5e638
Create CLAP demo (#442) 2023-12-08 19:43:10 +02:00
Joshua Lochner ff3019fc05
Add example usage for `SpeechT5ForSpeechToText` (#438) 2023-12-06 22:17:11 +02:00
Joshua Lochner cb8a5961df [version] Update to 2.10.1 2023-12-06 18:48:41 +02:00
Joshua Lochner 374c1052a7
Standardize `HF_ACCESS_TOKEN` -> `HF_TOKEN` (#431) 2023-12-06 18:33:50 +02:00
Joshua Lochner ceb75dccf9
Update vite version for example applications (#435) 2023-12-06 18:33:15 +02:00
Joshua Lochner d318b1f243
Fix zero-shot-object-detection `percentage` option (#434) 2023-12-06 18:23:53 +02:00
Joshua Lochner c0c746b056 Update issue templates 2023-12-06 17:15:29 +02:00
Joshua Lochner 9a8c664c2c
Documentation improvements (#299)
* Add link to optimum docs for supported architectures

Closes #288

* Refactor `SUPPORTED_MODELS` dict to include task

* Update example model id

* Update list of supported models

* Update generate_tests.py

* Remove requirement of `output_attentions` revision

* Add demo site to examples section (closes #233)

* Fix typo

* Include examples in docs index

* Update github issue templates

* Create config.yml

* Order supported models

* Cleanup

* Update 4_feature-request.yml
2023-12-06 17:01:36 +02:00