Commit Graph

10279 Commits

Author SHA1 Message Date
Gorkem Ozkaya
f58b9c0522
Update translation.mdx (#18169)
* Update translation.mdx

* update translation.mdx by running make style
2022-07-26 07:56:40 -04:00
Yih-Dar
b51695274a
Add TFAutoModelForImageClassification to pipelines.py (#18292)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-07-26 13:44:54 +02:00
Tom Mathews
f374d3918f
Adding type hints of TF:OpenAIGPT (#18263) 2022-07-26 12:30:06 +01:00
Tom Mathews
5bb211be6e
Adding type hints of TF:CTRL (#18264) 2022-07-26 12:27:02 +01:00
Sylvain Gugger
c8ed1b8b59
Replace false parameter by a buffer (#18259) 2022-07-26 13:02:58 +02:00
Jingya HUANG
2844c5de10
Fix ORTTrainer failure on gpt2 fp16 training (#18017)
* Ensure value and attn weights have the same dtype

* Remove prints

* Modify decision transformers copied from gpt2

* Nit device

Co-authored-by: Lysandre Debut <lysandre@huggingface.co>

* Fix style

Co-authored-by: Lysandre Debut <lysandre@huggingface.co>
2022-07-26 04:14:08 -04:00
gilad19
2b09650885
Add ViltForTokenClassification e.g. for Named-Entity-Recognition (NER) (#17924)
* Add ViltForTokenClassification e.g. for Named-Entity-Recognition (NER)

* Add ViltForTokenClassification e.g. for Named-Entity-Recognition (NER)

* provide classifier only text hidden states

* add test_for_token_classification

* Update src/transformers/models/vilt/modeling_vilt.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* Update src/transformers/models/vilt/modeling_vilt.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* Update src/transformers/models/vilt/modeling_vilt.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* Update src/transformers/models/vilt/modeling_vilt.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* add test_for_token_classification

Co-authored-by: gfuchs <gfuchs@ebay.com>
Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
2022-07-26 10:11:32 +02:00
Alara Dirik
002915aa2a
Owlvit docs test (#18257)
* fix docs and add owlvit docs test

* fix minor bug in post_process, add to processor

* improve owlvit code examples

* fix hardcoded image size
2022-07-26 10:55:14 +03:00
Lysandre Debut
d32558cc7a
Good difficult issue override for the stalebot (#18094) 2022-07-26 03:39:14 -04:00
Yih-Dar
f65307e498
Fix dtype of input_features in docstring (#18258)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-07-26 09:34:06 +02:00
Raghavan
bd87480d20
Fix command of doc tests for local testing (#18236)
* Fix command of doc tests for local testing

* Fix command for after running doc tests locally
2022-07-26 03:07:11 -04:00
Matt
45a1475462
Fix TF bad words filter with XLA (#18286)
* Fix bad words filter in XLA generation

* Remove my cool debug breakpoints (again)
2022-07-25 20:19:39 +01:00
Matt
f4e172716b
Allows KerasMetricCallback to use XLA generation (#18265)
* Allows `KerasMetricCallback` to use XLA generation

* make fixup

* Slightly reword docstring
2022-07-25 12:51:37 +01:00
Yih-Dar
bbb62f2924
Skip passes report for --make-reports (#18250)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-07-25 11:09:23 +02:00
Joao Gante
7e44226fc7
Generate: deprecate default max_length (#18018) 2022-07-23 18:02:03 +01:00
amyeroberts
8e8384663d
Update serving code to enable saved_model=True (#18153)
* Add serving_output and serving methods to some vision models

* Add serving outputs for DeiT

* Don't convert hidden states - differing shapes

* Make saveable

* Fix up

* Make swin saveable

* Add in tests

* Fix funnel tests (can't convert to tensor)

* Fix numpy call

* Tidy up a bit

* Add in hidden states - resnet

* Remove numpy

* Fix failing tests - tensor shape and skipping tests

* Remove duplicated function

* PR comments - formatting and var names

* PR comments
Add suggestions made by Joao Gante:
* Use tf.shape instead of shape_list
* Use @tooslow decorator on tests
* Simplify some of the logic

* PR comments
Address Yih-Dar Sheih comments - making tensor names consistent and make types float

* Types consistent with docs; disable test on swin (slow)

* CI trigger

* Change input_features to float32

* Add serving_output for segformer

* Fixup

Co-authored-by: Amy Roberts <amyeroberts@users.noreply.github.com>
2022-07-22 18:05:38 +01:00
Matt
07505358ba
Change how take_along_axis is computed in DeBERTa to stop confusing XLA (#18256)
* Change how `take_along_axis` is computed in DeBERTa to stop confusing XLA

* Greatly simplify take_along_axis() since the code wasn't using most of it
2022-07-22 17:01:30 +01:00
Yih-Dar
d95a32cc60
Fix torch version check in Vilt (#18260)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-07-22 16:24:49 +02:00
Muhammad Ahmed
7cb4da13fe
change bloom parameters to 176B (#18235) 2022-07-22 10:17:48 -04:00
Joao Gante
1fc4b2a132
TF: use the correct config with (...)EncoderDecoder models (#18097) 2022-07-22 13:31:45 +01:00
Fx039482
4935409757
Add Italian translation of create_model.mdx and serialization.mdx (#17640)
* First commit

* final changes

* Changed create_model to create_a_model
Translated into crea un'architettura personalizzata in the file it/_toctree.yml

* Added _toctree.yml in the italian translation loca: serialization title Esporta modelli transformers

* Edit translation for create_model.mdx

* t with '#' will be ignored, and an empty message aborts the commit.

* Added file serialization for translation in italian

* Fix toctree serialization position

I checked the eng toctree and realized I made a mistake.

* Update _toctree.yml

Correct spacing

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-07-22 13:53:54 +02:00
Sylvain Gugger
06d98e272e
Fix OwlViT tests (#18253)
* Fix OwlViT tests

* Forgot one
2022-07-22 13:32:19 +02:00
Alara Dirik
12d66b4701
Add OWL-ViT model for zero-shot object detection (#17938)
* add owlvit model skeleton

* add class and box predictor heads

* convert modified flax clip to pytorch

* fix box and class predictors

* add OwlViTImageTextEmbedder

* convert class and box head checkpoints

* convert image text embedder checkpoints

* add object detection head

* fix bugs

* update conversion script

* update conversion script

* fix q,v,k,out weight conversion conversion

* add owlvit object detection output

* fix bug in image embedder

* fix bugs in text embedder

* fix positional embeddings

* fix bug in inference mode vision pooling

* update docs, init tokenizer and processor files

* support batch processing

* add OwlViTProcessor

* remove merge conflicts

* readd owlvit imports

* fix bug in OwlViTProcessor imports

* fix bugs in processor

* update docs

* fix bugs in processor

* update owlvit docs

* add OwlViTFeatureExtractor

* style changes, add postprocess method to feature extractor

* add feature extractor and processor tests

* add object detection tests

* update conversion script

* update config paths

* update config paths

* fix configuration paths and bugs

* fix bugs in OwlViT tests

* add import checks to processor

* fix docs and minor issues

* fix docs and minor issues

* fix bugs and issues

* fix bugs and issues

* fix bugs and issues

* fix bugs and issues

* update docs and examples

* fix bugs and issues

* update conversion script, fix positional embeddings

* process 2D input ids, update tests

* fix style and quality issues

* update docs

* update docs and imports

* update OWL-ViT index.md

* fix bug in OwlViT feature ext tests

* fix code examples, return_dict by default

* return_dict by default

* minor fixes, add tests to processor

* small fixes

* add output_attentions arg to main model

* fix bugs

* remove output_hidden_states arg from main model

* update self.config variables

* add option to return last_hidden_states

* fix bug in config variables

* fix copied from statements

* fix small issues and bugs

* fix bugs

* fix bugs, support greyscale images

* run fixup

* update repo name

* merge OwlViTImageTextEmbedder with obj detection head

* fix merge conflict

* fix merge conflict

* make fixup

* fix bugs

* fix bugs

* add additional processor test
2022-07-22 13:35:32 +03:00
Zachary Mueller
99eb9b523f
Fix no_trainer CI (#18242)
* Fix all tests
2022-07-21 14:44:57 -04:00
Sayak Paul
561b9a8c00
[SegFormer] TensorFlow port (#17910)
* add: segformer utils and img. classification.

* add: segmentation layer.

* feat: working implementation of segformer.

* chore: remove unused variable.

* add test, remaining modifications.

* remove: unnecessary files.

* add: rest of the files.

Co-authored-by: matt <rocketknight1@gmail.com>

* chore: remove ModuleList comment.

* chore: apply make style.

* chore: apply make fixup-copies.

* add  to check_repo.py

* add decode head to IGNORE_NON_TESTED

* chore: run make style.

* chore: PR comments.

* chore: minor changes to model doc.

* tests: reduction across samples.

* add a note on the space.

* sort importats.

* fix: reduction in loss computation.

* chore: align loss function with that of NER.

* chore: correct utils/documentation_tests.txt

Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>

* chore: simplify the interpolation of logits in loss computation.

* chore: return transposed logits when return_dict=False.

* chore: add link to the tf fine-tuning repo.

* address pr comments.

* address niels's comments.

* remove from_pt=True since tf weights are in.

* remove comment from pt model.

* address niels's comments.

Co-authored-by: matt <rocketknight1@gmail.com>
Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
2022-07-21 18:22:37 +01:00
Yih-Dar
2c5747edfe
Update notification service (#17921)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-07-21 15:03:50 +02:00
Martina Fumanelli
07575e869d
Italian/accelerate (#17698)
* Add 'accelerate' to _toctree file

* Fix 'training with a nb' title

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-07-21 14:23:47 +02:00
Martina Fumanelli
8881e58b22
Italian/model sharing (#17828)
* Add Italian translation of the doc file model_sharing.mdx

* Fix style

* Fix typo

* Update docs/source/it/_toctree.yml

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-07-21 14:07:53 +02:00
Lorenzo Balzani
0d971be84f
Italian translation of run_scripts.mdx gh-17459 (#17642)
* Run_scripts Italian translation gh-17459

* Updated run_scripts gh-17642

* Updated run_scripts gh-17642

Made the text more gender-neutral.

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-07-21 12:02:08 +02:00
Sylvain Gugger
ba552dd027
Make errors for loss-less models more user-friendly (#18233) 2022-07-21 11:52:33 +02:00
Sylvain Gugger
43a5375cc1
Fix TrainingArguments help section (#18232) 2022-07-21 11:03:25 +02:00
Nicola Procopio
9f787ce874
Translation/debugging (#18230)
* added debugging.mdx

* updated debugging.mdx

* updated translation

* updated translation debugging

* translated debugging

* updated _toctree.yml
2022-07-21 11:02:26 +02:00
Sebastian Sosa
5e2f2d7dd2
Better messaging and fix for incorrect shape when collating data. (#18119)
* More informative error message

* raise dynamic error

* remove_excess_nesting application

* incorrect shape assertion for collator & function to remove excess nesting from DatasetDict

* formatting

* eliminating datasets import

* removed and relocated remove_excess_nesting to the datasets library and updated docs accordingly

* independent assert instructions

* inform user of excess nesting
2022-07-21 10:35:41 +02:00
Victor Zhu
d23cf5b1f1
Add support for Sagemaker Model Parallel >= 1.10 new checkpoint API (#18221)
* Add support for Sagemaker Model Parallel >= 1.10 new checkpoint API

* Support loading checkpoints saved with SMP < 1.10 in SMP < 1.10 and SMP >= 1.10

* Support loading checkpoints saved with SMP >= 1.10 in SMP >= 1.10

* Fix bug and styling

* Update based on reviewer feedback
2022-07-21 07:56:20 +02:00
Zhi Zheng
dbfeffd7c9
Update add_new_pipeline.mdx (#18224)
fix typo
2022-07-21 07:55:30 +02:00
Steven Liu
ff56b8fbff
Add custom config to quicktour (#18115)
* 📝 first draft of new quicktour

* make style

* 🖍 edit and review

* 🖍 small fixes

* 🖍 only add custom config section

* 🖍 use autoclass instead
2022-07-20 12:23:03 -05:00
Yih-Dar
9edff45362
skip some test_multi_gpu_data_parallel_forward (#18188)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-07-20 15:54:44 +02:00
Yih-Dar
bc6fe6fbcf
Change to FlavaProcessor in PROCESSOR_MAPPING_NAMES (#18213)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-07-20 12:30:14 +02:00
Raghavan
dcec4c4387
Adding OPTForSeqClassification class (#18123)
* Adding OPTForSeqClassification class

* Fix import issues

* Add documentation for optforseqclassification

* Remove checkout

* fix failing tests

* fix typo

* Fix code formatting

* Incorporating the PR feedbacks

* Incorporate PR Feedbacks

* Fix failing test and add new test for multi label setup

* Fix formatting issue

* Fix failing tests

* Fix formatting issues

* Fix failing tests

* Fix failing tests

* Fix failing tests

* Fix failing tests

* PR feedback
2022-07-20 10:14:21 +02:00
Li-Huai (Allan) Lin
0ed4d0dfb6
Fix LayoutXLM docstrings (#17038)
* Fix docstrings

* Fix legacy issue

* up

* apply suggestions

* up

* quality
2022-07-20 09:49:57 +02:00
Yih-Dar
4b1ed7979f
update cache to v0.5 (#18203)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
2022-07-20 08:14:10 +02:00
Matt
8a61fe0234
Reduce console spam when using the KerasMetricCallback (#18202)
* Reduce console spam when using the KerasMetricCallback

* Switch to predict_on_batch to improve performance
2022-07-19 17:00:35 +01:00
Joao Gante
ec6cd7633f
TF: Add missing cast to GPT-J (#18201)
* Fix TF GPT-J tests

* add try/finally block
2022-07-19 15:58:42 +01:00
Yih-Dar
05ed569c79
Use next-gen CircleCI convenience images (#18197)
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-07-19 15:43:05 +02:00
flozi00
9f12ec7d87
Typo in readme (#18195) 2022-07-19 15:28:37 +02:00
Sylvain Gugger
dc9147ff36
Custom pipeline (#18079)
* Initial work

* More work

* Add tests for custom pipelines on the Hub

* Protect import

* Make the test work for TF as well

* Last PyTorch specific bit

* Add documentation

* Style

* Title in toc

* Bad names!

* Update docs/source/en/add_new_pipeline.mdx

Co-authored-by: Lysandre Debut <lysandre.debut@reseau.eseo.fr>

* Auto stash before merge of "custom_pipeline" and "origin/custom_pipeline"

* Address review comments

* Address more review comments

* Update src/transformers/pipelines/__init__.py

Co-authored-by: Lysandre Debut <lysandre.debut@reseau.eseo.fr>

Co-authored-by: Lysandre Debut <lysandre.debut@reseau.eseo.fr>
2022-07-19 12:02:35 +02:00
Patrick von Platen
3bb6356d4d
[From pretrained] Allow download from subfolder inside model repo (#18184)
* add first generation tutorial

* [from_pretrained] Allow loading models from subfolders

* remove gen file

* add doc strings

* allow download from subfolder

* add tests

* Apply suggestions from code review

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* apply comments

* correct doc string

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2022-07-19 11:53:53 +02:00
Snehan Kekre
ce0152819d
Update docs README with instructions on locally previewing docs (#18196)
* Update docs README with instructions on locally previewing docs

* Add instructions to install `watchdog` before previewing the docs
2022-07-19 11:47:26 +02:00
orgoro
798384467b
bugfix: div-->dim (#18135) 2022-07-19 10:24:56 +02:00
Sylvain Gugger
e630dad555
Add vision example to README (#18194) 2022-07-19 09:46:18 +02:00