repo
stringclasses
1 value
number
int64
1
25.3k
state
stringclasses
2 values
title
stringlengths
1
487
body
stringlengths
0
234k
created_at
stringlengths
19
19
closed_at
stringlengths
19
19
comments
stringlengths
0
293k
transformers
25,205
open
Using Trainer with torch.compile() and use_orig_params=True produce model checkpoints that cannot be loaded
### System Info - `transformers` version: 4.32.0.dev0 - Platform: Linux-4.18.0-477.10.1.el8_8.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.7 - Huggingface_hub version: 0.14.1 - Safetensors version: 0.3.1 - Accelerate version: 0.21.0 - Accelerate config: - compute_environment: LOCAL_MACHINE - distribut...
07-31-2023 10:42:35
07-31-2023 10:42:35
I think this comes from a bas interaction between `torch.compile` and FSDP, cc @pacman100
transformers
25,204
closed
auto move input to device of the first-layer if necessary
# What does this PR do? This PR adds feature to model.generate() to check if input_ids is at the same device of input_embeddings. If not, move input to the device rather than simply raising an error or warning. It should be helpful when device_map="auto" or when there are multi-gpus to choose from, in which case w...
07-31-2023 10:22:33
07-31-2023 10:22:33
_The documentation is not available anymore as the PR was closed or merged._<|||||>Hi @ranchlai, thanks to opening this PR! Could you share a code snippet that we can run which would currently fail on main and which runs with this update? cc @gante <|||||>@amyeroberts We don't automatically move tensors in si...
transformers
25,203
closed
add pathname and line number to logging formatter in debug mode
# What does this PR do? This PR adds pathname and line number to logging formatter in debug mode It make the debug much easier when setting `export TRANSFORMERS_VERBOSITY=debug`. It has no effect in other logging levels(info, warning, etc ). Hope this is acceptable. It's ok if not. before, there is no way t...
07-31-2023 10:08:20
07-31-2023 10:08:20
_The documentation is not available anymore as the PR was closed or merged._<|||||>hi, @amyeroberts thanks very much for commenting! I have added a "detail" level. It's the same as debug but will also print the pathname and line-number for easy debugging. I don't know if that looks good ? Thanks!
transformers
25,202
closed
Better error message in `_prepare_output_docstrings`
# What does this PR do? Currently, if an output type has no docstring, or its docstring doesn't have `Args` or `Parameters`, we get an error ```bash File "/transformers/src/transformers/utils/doc.py", line 137, in _prepare_output_docstrings full_output_type = f"{output_type.__module__}.{output_type.__name_...
07-31-2023 09:35:42
07-31-2023 09:35:42
_The documentation is not available anymore as the PR was closed or merged._
transformers
25,201
closed
[`MPT`] Add `require_bitsandbytes` on MPT integration tests
# What does this PR do? As per title and as discussed offline with @ydshieh adding `require_bitsandbytes` is needed to avoid issues with past torch CI that doesn't have bnb installed on their Docker images. cc @ydshieh
07-31-2023 08:51:40
07-31-2023 08:51:40
_The documentation is not available anymore as the PR was closed or merged._<|||||>Jus out of curiosity does the `tooslow` decorator leads to tests still being run? ```bash Slow tests are skipped while they're in the process of being fixed. No test should stay tagged as "tooslow" as these will not be tested...
transformers
25,200
closed
[`Pix2Struct`] Fix pix2struct cross attention
# What does this PR do? Fixes https://github.com/huggingface/transformers/issues/25175 As pointed out by @leitro on the issue, I can confirm the cross-attention should be in `layer_outputs[5]`. Also fixes the attention output index that should be in index `3` as the index `2` is the `position_bias` (they have the...
07-31-2023 08:48:55
07-31-2023 08:48:55
_The documentation is not available anymore as the PR was closed or merged._<|||||>Fixed a slow test of torchscript that was failing, however the test: ```bash tests/models/pix2struct/test_modeling_pix2struct.py::Pix2StructIntegrationTest::test_batched_inference_image_captioning_conditioned ``` is failing but c...
transformers
25,199
closed
[LLaMA] Rotary positional embedding differs with official implementation
`transformers` implement LLaMA model's Rotary Positional Embedding (RoPE) as follows: https://github.com/huggingface/transformers/blob/e42587f596181396e1c4b63660abf0c736b10dae/src/transformers/models/llama/modeling_llama.py#L173-L188 This is **GPT-NeoX style** RoPE. But in Meta's official model implementation, th...
07-31-2023 08:35:57
07-31-2023 08:35:57
transformers
25,198
open
Save tokenizer and model config when training with FSDP
# What does this PR do? Currently when training models with FSDP the tokenizer and model config are not saved (at least using standard configs I have). This is especially bad when running a custom train.py that modifies the tokenizer and model before training. In that scenario there is no record of the new model con...
07-31-2023 08:07:25
07-31-2023 08:07:25
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25198). All of your documentation changes will be reflected on that endpoint.
transformers
25,197
open
Multi-threaded parallel inferrence problem
### System Info accelerate == 0.19.0 bitsandbytes == 0.37.1 - `transformers` version: 4.29.2 - Platform: Linux-3.10.0-1160.92.1.el7.x86_64-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.14.1 - Safetensors version: not installed - PyTorch version (GPU?): 2.0.0+cu117 (True) - Tenso...
07-31-2023 07:05:51
07-31-2023 07:05:51
Hi @zhaotyer, thanks for opening this issue! Could you edit the issue details to make sure that the code and traceback are properly formatted? This will make it easier for us to read and understand what's going on. The code examples should be wrapped around three backticks. You can also specify the language to ...
transformers
25,196
open
[DOCS] Add descriptive docstring to MinNewTokensLength
# What does this PR do? It addresses one of the arguments in https://github.com/huggingface/transformers/issues/24783 ## Before submitting - [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). ## Who can review? @gante
07-31-2023 06:22:57
07-31-2023 06:22:57
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25196). All of your documentation changes will be reflected on that endpoint.<|||||>cc @gante <|||||>> Thank you for iterating raised_hands Always a pleasure, thanks for the opportunity :hugs:
transformers
25,195
open
Incorrect segmentation results on float input in 4.31.0
### System Info python-3.9.10 transformers-4.31.0 pytorch-2.0.1 ### Who can help? @amyeroberts ### Information - [X] The official example scripts - [X] My own modified scripts ### Tasks - [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or dataset (give deta...
07-31-2023 04:26:57
07-31-2023 04:26:57
cc @amyeroberts this seems to be the same issue as discussed in https://github.com/huggingface/transformers/issues/24857. Basically there's no need to rescale the images yourself before passing them to the image processor. The image processor already handles the rescaling for you. Alternatively, if you want to h...
transformers
25,194
open
`AutoTokenizer.from_pretrained` raise error when another same filename tokenizer imported
### System Info - `transformers` version: 4.28.1 - Platform: Linux-4.19.91-009.ali4000.alios7.x86_64-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.2 - Safetensors version: 0.3.1 - PyTorch version (GPU?): 2.0.1+cu117 (True) - Tensorflow version (GPU?): not installed (NA) - Flax v...
07-31-2023 02:52:01
07-31-2023 02:52:01
I think you should report the issue in the repositories where this code comes from, as the fix you suggest is in that code (and not in the Transformers library).<|||||>hmmm that's an ad-hoc solution to validate the problem, and I'm not sure whether this import error is expected by Transformers?<|||||>I don't see an imp...
transformers
25,193
closed
make build_mpt_alibi_tensor a method of MptModel so that deepspeed co…
…uld override it to make autoTP work # What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome cont...
07-31-2023 02:23:00
07-31-2023 02:23:00
@sgugger @ArthurZucker please review. thanks<|||||>should work with https://github.com/microsoft/DeepSpeed/pull/4062<|||||>_The documentation is not available anymore as the PR was closed or merged._
transformers
25,192
open
Unable to upload/load a tool.
### System Info - transformers version: 4.31.0 - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.11.3 - Huggingface_hub version: 0.16.4 - Safetensors version: 0.3.1 - Accelerate version: 0.21.0 - Accelerate config: not found - PyTorch version (GPU?): 2.0.1+cu118 (True) - Tensorflow version (GPU?):...
07-30-2023 20:54:38
07-30-2023 20:54:38
Hi @Romainlg29, thanks for reporting this issue! Could you update the issue information with the full running environment info: run `transformers-cli env` in the terminal and copy-paste the output? cc @LysandreJik <|||||>Hi, I just updated the config, which is: ``` transformers version: 4.31.0 Platform:...
transformers
25,191
closed
_forward_unimplemented() got an unexpected keyword argument 'input_ids'
### System Info I am training on Google Colab Pro+ with following info: - `transformers` version: 4.31.0 - Platform: Linux-5.15.109+-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.4 - Safetensors version: 0.3.1 - Accelerate version: 0.21.0 - Accelerate config: not found - Py...
07-30-2023 18:26:17
07-30-2023 18:26:17
I have add another `forward` method for my `MultiTaskModel `and the error is gone even though the new one appear.
transformers
25,190
closed
[quantization.md] fix
Fix typos (use case is 2 words)
07-30-2023 16:27:22
07-30-2023 16:27:22
_The documentation is not available anymore as the PR was closed or merged._
transformers
25,189
closed
Can BlipForImageTextRetrieval be used to generate captions?
### System Info `transformers` version: 4.31.0.dev0 Platform: Linux-5.15.0-76-generic-x86_64-with-debian-bullseye-sid Python version: 3.7.15 Huggingface_hub version: 0.15.1 Safetensors version: 0.3.1 PyTorch version (GPU?): 1.13.1+cu117 (True) Tensorflow version (GPU?): 2.11.0 (False) Flax version (CPU?/GPU?/TP...
07-30-2023 14:49:22
07-30-2023 14:49:22
Hey! Since you are not reporting a bug, could you open a discussion on [the forum](https://discuss.huggingface.co/) for this kind of questions?<|||||>Sure, apologies. <|||||>No worries! 🤗 Feel free to ping @younesbelkada there
transformers
25,188
open
Loosen output shape restrictions on GPT-style models
# What does this PR do? This PR loosens checks in the model classes of a couple of GPT-style models that enforce the output shape of the model to be identical to the input shape. This aligns the changed model classes to most other model classes which don't enforce the shapes to be identical. I might not be aware ...
07-30-2023 11:30:04
07-30-2023 11:30:04
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25188). All of your documentation changes will be reflected on that endpoint.<|||||>In principle, it should be OK to loosen this restriction as it doesn't introduce any breaking changes. However, it is making the code more likely ...
transformers
25,187
closed
Loading LLaMA model does not use GPU memory neither offload folder
### System Info - `transformers` version: 4.32.0.dev0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.16.4 - Safetensors version: 0.3.1 - Accelerate version: 0.21.0 - Accelerate config: not found - PyTorch version (GPU?): 2.0.1...
07-30-2023 09:17:57
07-30-2023 09:17:57
cc @sgugger <|||||>Hi @not4fame , can you print the `device_map` of the model by printing `model.hf_device.map` ? What do you mean that it is not using the `offloaded folder` ? To me, if you were able to load your model without error, it means that you are indeed using disk offload as your GPU RAM + RAM < model size. A...
transformers
25,186
open
[DOCS] Add `NoRepeatNGramLogitsProcessor` Example for `LogitsProcessor` class
# What does this PR do? This PR adds an example to the docstring of `NoRepeatNGramLogitsProcessor` and edits the docstring description of the same. This is with reference to #24783 and is part of the #24575 Fixes # (issue) #24783 ## Before submitting - [x] This PR fixes a typo or improves the docs (you can...
07-29-2023 22:08:42
07-29-2023 22:08:42
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25186). All of your documentation changes will be reflected on that endpoint.<|||||>Hey @gante Thanks for your feedback. I've made the requested changes. Let me know what you think. <|||||>@gante I've made the recommended changes....
transformers
25,185
open
conversational + text-generation pipelines fail to read max_length from GenerationConfig
### System Info - `transformers` version: 4.32.0.dev0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.10.5 - Huggingface_hub version: 0.16.4 - Safetensors version: 0.3.1 - Accelerate version: not installed - Accelerate config: not found - PyTorch version (GPU?): 2.0.1 (False) - Tensorflow version ...
07-29-2023 17:36:54
07-29-2023 17:36:54
Hey @yonigottesman 👋 We are aware of this issue, where `GenerationConfig` is not being piped correctly at input verification time. This requires a pipeline-level change (and not simply a `Conversation`-level change), and we are working on it :)
transformers
25,184
closed
Add timeout parameter to load_image function
# What does this PR do? This PR adds a timeout parameter to all pipelines that can fetch images from remote URLs. Without a timeout, the request can hang indefinitely. Fixes #25168 ## Before submitting - [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). -...
07-29-2023 15:27:11
07-29-2023 15:27:11
_The documentation is not available anymore as the PR was closed or merged._<|||||>@amyeroberts I've done the requested changes
transformers
25,183
open
audio pipeline utility ffmpeg_microphone_live doesn't work in Google Colab
### System Info Googel Colab 2023/07/21 / Chrome 115.0.5790.114 / macOS 13.5 Default MacBook microphone ### Who can help? @sanchit-gandhi ### Information - [ ] The official example scripts - [ ] My own modified scripts ### Tasks - [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ....
07-29-2023 14:02:10
07-29-2023 14:02:10
Hey @crcdng! Thanks for flagging this - could you share details of how you achieved step 1 (make sure microphone works and access to microphone is enabled in Colab)? Once I can reproduce I can take a look into how we can get this working!
transformers
25,182
open
Knowledge distillation tutorial initial commit
This is a documentation PR for task guide to show how to distil an image classification model into another, using `Trainer`. I also tried to explain my intuition about distillation process so let me know if there's anything else to clarify.
07-29-2023 09:09:53
07-29-2023 09:09:53
transformers
25,181
open
RagGenerator
### System Info import os from transformers import RagTokenizer, RagTokenForGeneration from datasets import load_dataset dataset_path = '/Volumes/WD_BLACK/Pycharm/dataset/downloads' # 修改为外部硬盘的路径 dataset = load_dataset(dataset_path, "psgs_w100.nq.compressed") model_name = 'facebook/rag-token-base' tokenize...
07-29-2023 07:10:11
07-29-2023 07:10:11
Hi @MaskXman, thanks for raising this issue! So that we can best help you, could you please: * Make sure there is a minimal reproducible code snippet. We don't have access to the dataset used: `/Volumes/WD_BLACK/Pycharm/dataset/downloads'`. Either a dummy dataset can be created in the script or a public dataset o...
transformers
25,180
open
Accelerator FSDP state does not reflect the arguments fsdp_config
### System Info - `transformers` version: 4.31.0 - Platform: Linux-4.18.0-477.15.1.el8_8.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.17 - Huggingface_hub version: 0.16.4 - Safetensors version: 0.3.1 - Accelerate version: 0.21.0 - Accelerate config: not found - PyTorch version (GPU?): 2.0.1 (True) - Tens...
07-29-2023 02:41:34
07-29-2023 02:41:34
cc @pacman100
transformers
25,179
closed
Sudden random bug
### System Info Here is the bug ``` File "/home/suryahari/Vornoi/QA.py", line 5, in <module> model = AutoModelForQuestionAnswering.from_pretrained("deepset/roberta-base-squad2") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/suryahari/miniconda3/en...
07-28-2023 23:29:59
07-28-2023 23:29:59
I can't really reproduce this and have not seen this anywhere else. The OS Error suggests that the interface is not available, meaning that most probably the path to your hugging face cache cannot be reached (not mounted/ not right etc). A [simple reproducer](https://colab.research.google.com/drive/1S7CRnNIUPnmDWcTuFY4...
transformers
25,178
open
BERT: TensorFlow Model Garden Conversion scripts
### Feature request Hi, after working some time with the [TensorFlow Model Garden Repository](https://github.com/tensorflow/models) and training BERT models, I found out the following things that could be changed in Transformers library: I added the Token Dropping BERT Conversion script a while ago, see #17142...
07-28-2023 23:08:17
07-28-2023 23:08:17
cc @Rocketknight1 <|||||>This isn't really my area either! A lot of this code goes back to the earliest code in `transformers` when it was a port of TF code for BERT to PyTorch. Pinging @LysandreJik - do you know if the code is intended to support ports from recent versions of the TF Model Garden?<|||||>As long as ever...
transformers
25,177
open
TEAMS: Add TensorFlow 2 Model Garden Conversion Script
Hi, with this PR a pretrained TEAMS model with TensorFlow Models Garden can be converted to an ELECTRA compatible model. The TEAMS model was proposed in the "[Training ELECTRA Augmented with Multi-word Selection](https://aclanthology.org/2021.findings-acl.219.pdf) paper and accepted at ACL 2021: > A new text e...
07-28-2023 22:29:24
07-28-2023 22:29:24
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25177). All of your documentation changes will be reflected on that endpoint.<|||||>cc @Rocketknight1
transformers
25,176
open
Llama Tokenizer Unexpectedly Producing Unknown Token
### System Info - `transformers` version: 4.29.2 - Platform: Linux-5.19.0-1027-aws-x86_64-with-glibc2.31 - Python version: 3.10.8 - Huggingface_hub version: 0.14.1 - Safetensors version: 0.3.1 - PyTorch version (GPU?): 2.0.1+cu118 (True) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU...
07-28-2023 20:19:14
07-28-2023 20:19:14
Hey! 👋🏻 Thanks for providing a reproduction script. I suspect that you do not have `tokenizers` installed, since when I use `use_fast = True` (which is the default if you have tokenizers) the issue is not present. Now, this behaviour is expected: - Quick fix, use `legacy=True` when initialising the tokenizer: `t...
transformers
25,175
closed
Pix2Struct -- mismatched output of cross attention weights
### System Info Hi huggingface team! The output of cross attention weights is mismatched as shown in [https://github.com/huggingface/transformers/blob/05cda5df3405e6a2ee4ecf8f7e1b2300ebda472e/src/transformers/models/pix2struct/modeling_pix2struct.py#L1551C22-L1551C22](https://github.com/huggingface/transformers/bl...
07-28-2023 20:11:25
07-28-2023 20:11:25
Nice catch @leitro ! I can confirm this is correct, just made https://github.com/huggingface/transformers/pull/25200 to fix the issue on the main branch.<|||||>Cheers!!
transformers
25,174
closed
🚨🚨🚨 Fix rescale ViVit Efficientnet
# What does this PR do? Fixes the rescaling logic for both EffiicentNet and ViVit. EfficientNet: The values were being rescale between [-0.5, 0.5] ViVit: values were being rescale between [-7.689350249903882e-06, 0.9999923106497501] as scale was being treated as having a value 255 in the `rescale` method, ra...
07-28-2023 15:50:07
07-28-2023 15:50:07
_The documentation is not available anymore as the PR was closed or merged._<|||||>If I'm not mistaken this PR is problematic as it breaks the `rescale` function. If I rebase my PR https://github.com/huggingface/transformers/pull/24796 to `main` the torchvision transforms vs transformers image transforms equivalency te...
transformers
25,173
closed
Musicgen: CFG is manually added
# What does this PR do? This PR exists to keep `musicgen`'s current functionalities considering the changes in #24654. In a nutshell, the #24654 has a more flexible version of CFG (allows negative prompting, is compatible with existing generation methods, doesn't need to expand the batch size by 2 before the fwd ...
07-28-2023 15:22:19
07-28-2023 15:22:19
@sanchit-gandhi there is a potential change due to order of operations, depending on the processors commonly used. Would you be able to confirm whether it would be okay like this?<|||||>_The documentation is not available anymore as the PR was closed or merged._
transformers
25,172
closed
Add `token` arugment in example scripts
# What does this PR do? If the change is good, I will apply the same to other files. Let me know if you have opinion on the `False` vs `None` thing here.
07-28-2023 15:21:36
07-28-2023 15:21:36
_The documentation is not available anymore as the PR was closed or merged._<|||||>@sgugger Ready to go 🚀 <|||||>Thank you for the review, changed it to ```python token: str = field( default=None, metadata={ "help": ( "The token to use as HTTP bearer authorizati...
transformers
25,171
closed
[`InstructBlip`] Fix instructblip slow test
# What does this PR do? Fixes the current failing daily CI test: https://github.com/huggingface/transformers/actions/runs/5675853423/job/15381807774 let's make the daily CI happy! Ran the test on the latest docker image and the test now pass with these values. cc @sgugger @ydshieh
07-28-2023 13:57:05
07-28-2023 13:57:05
_The documentation is not available anymore as the PR was closed or merged._<|||||>The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25171). All of your documentation changes will be reflected on that endpoint.
transformers
25,170
closed
[`Mpt`] Fix mpt slow test
# What does this PR do? As per title, failure report here: https://github.com/huggingface/transformers/actions/runs/5675853423/job/15381788713 Probably an issue with libs I had when designing the tests (had torch +cu117 instead of cu118) - ran the tests on the latest docker image and they all pass cc @sgugger ...
07-28-2023 13:40:53
07-28-2023 13:40:53
_The documentation is not available anymore as the PR was closed or merged._
transformers
25,169
closed
[MusicGen] Fix integration tests
# What does this PR do? Fixes the integration tests for MusicGen: 1. Places all input tensors on the correct device 2. Updates expected values with those obtained on cuda 3. Fixes for fp16 generation cc @ydshieh
07-28-2023 12:09:32
07-28-2023 12:09:32
_The documentation is not available anymore as the PR was closed or merged._
transformers
25,168
closed
Add support for timeout parameter for load_image
### Feature request Add a parameter timeout to the `image_utils.py:load_image` function, which would enable setting the timeout for the requests call. This parameter should be plumbed in through all the ways to call that function (so add support for it in all the image related pipelines). Alternatively, you should ...
07-28-2023 09:33:35
07-28-2023 09:33:35
cc @amyeroberts Sounds like a good idea, so if you want to open a PR, please go ahead!<|||||>Do you have any preferences, keeping it simple, add just the timeout parameter, or adding a more general `requests_params`?<|||||>I think keeping it simple is probably for the best.
transformers
25,167
closed
Update `use_auth_token` -> `token` in example scripts
# What does this PR do? Update example scripts to use `token`. We have `datasets!=2.5.0` in transformers, and I see `datasets=2.7.0` still only uses `use_auth_token`, so I don't touch the usage in `load_dataset`. Let me know if we should change to `token` + pin a higher minimum `datasets` version. The files un...
07-28-2023 09:19:33
07-28-2023 09:19:33
`use_auth_token` has been deprecated in favor of `token` in the latest release of `datasets` 🙂. <|||||>> `use_auth_token` has been deprecated in favor of `token` in the latest release of `datasets` 🙂. Yes, I got to check it and update my comment :-) But thanks a lot for the information. It's very nice.<|||||>_T...
transformers
25,166
closed
override .cuda() to check if model is already quantized
# What does this PR do? This PR is a quick fix by adding .cuda() to prevent device casting after 8-bit quantization. Same spirit as #20409. @younesbelkada @sgugger Would you please have a quick look . It fixes the following unexpected error: ### For reberta-large, output `nan` without raising an error ```pyth...
07-28-2023 08:53:25
07-28-2023 08:53:25
_The documentation is not available anymore as the PR was closed or merged._
transformers
25,165
open
cached_file() got an unexpected keyword argument 'token'
### System Info transformers-4.32.0.dev0 ### Who can help? _No response_ ### Information - [ ] The official example scripts - [x] My own modified scripts ### Tasks - [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [x] My own task or dataset (give details below) ### Reproduc...
07-28-2023 08:49:59
07-28-2023 08:49:59
Hi, can you provide a full code snippet with which I can reproduce the error? <|||||>Hi I'm just loading the llama 2 model but from my local machine. I have an update however. I tested it on the latest pip install version and it works fine. So I think the code broke in between the pip version and the current status of...
transformers
25,164
closed
Represent query_length in a different way to solve jit issue
Hi @ArthurZucker @younesbelkada @sgugger Thanks for contributing to the MPT model. I found a jit issue with this model. ```python from transformers import AutoModelForCausalLM, AutoConfig from optimum.intel.generation.modeling import jit_trace model = AutoModelForCausalLM.from_pretrained("mosaicml/mpt-7b") ...
07-28-2023 08:28:16
07-28-2023 08:28:16
_The documentation is not available anymore as the PR was closed or merged._
transformers
25,163
open
torch.jit._trace.TracingCheckError: Tracing failed sanity checks! ERROR: Graphs differed across invocations!
### System Info - `transformers` version: 4.31.0 - Platform: Linux-4.18.0-2.4.3.3.kwai.x86_64-x86_64-with-glibc2.17 - Python version: 3.11.4 - Huggingface_hub version: 0.16.4 - Safetensors version: 0.3.1 - Accelerate version: not installed - Accelerate config: not found - PyTorch version (GPU?): 2.0.1+cu117 (Tr...
07-28-2023 08:25:14
07-28-2023 08:25:14
Hi it seems you code snippet is somehow different than what has been shown in the log where it has ```Cell In[24], line 4 2 out = model(t) 3 print(out[0].shape) ----> 4 t_model = torch.jit.trace(model, [t]) 5 print("ok") ``` Also the code snippet won't work for us as we don't have ckpt = "...
transformers
25,162
closed
torch.jit._trace.TracingCheckError: Tracing failed sanity checks! ERROR: Graphs differed across invocations!
### System Info - `transformers` version: 4.31.0 - Platform: Linux-4.18.0-2.4.3.3.kwai.x86_64-x86_64-with-glibc2.17 - Python version: 3.11.4 - Huggingface_hub version: 0.16.4 - Safetensors version: 0.3.1 - Accelerate version: not installed - Accelerate config: not found - PyTorch version (GPU?): 2.0.1+cu117 (Tr...
07-28-2023 08:17:25
07-28-2023 08:17:25
transformers
25,161
open
Update configuration_glpn.py
# What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this w...
07-28-2023 04:47:22
07-28-2023 04:47:22
C
transformers
25,160
open
"RuntimeError: expected scalar type Half but found Char" on LLaMa-2 () inference stage
### System Info Error when loading LLM with 8 bit quantization. **Versions:** tokenizers 0.13.3 transformers 4.31.0 **Error message:** ``` File "/opt/conda/lib/python3.10/site-packages/accelerate/hooks.py", line 165, in new_forward output = old_forward(*args, **kw...
07-28-2023 04:19:57
07-28-2023 04:19:57
cc @ArthurZucker <|||||>This is a duplicate of #25144. Make sure to check the `pretraining_tp` value in the config.json
transformers
25,159
open
Add GeoLM
# What does this PR do? Add a new model called **GeoLM** into the Transformer library. GeoLM is a language model based on BERT that facilitates **geospatial understanding** in NL documents. It is pretrained on world-wide OpenStreetMap (OSM), WikiData and Wikipedia data, and can be adapted to various geospatial relat...
07-28-2023 02:56:50
07-28-2023 02:56:50
Hi @zekun-li, thanks for opening this PR! The easiest and recommended way to make a model available in transformers is to add the modeling code directly on the hub: https://huggingface.co/docs/transformers/custom_models This means, once working, the model can be found and used immediately without having to go th...
transformers
25,158
open
Transformers not working with the new Jax 0.4.14 due to API deprecation
### System Info - `transformers` version: 4.31.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.14.1 - Safetensors version: 0.3.1 - Accelerate version: 0.21.0 - Accelerate config: not found - PyTorch version (GPU?): 2.0.0+cu117 ...
07-28-2023 02:43:51
07-28-2023 02:43:51
Hi @SystemPanic `transformers` currently only support `jax<=0.4.13` and `jaxlib<=0.4.13`. You can see that in https://github.com/huggingface/transformers/blob/400e76ef11d94a12c255fe1a598966e1d6021511/setup.py#L127-L128
transformers
25,157
closed
Unexpected GPU requests during training
### System Info - `transformers` version: 4.29.2 - Platform: Linux-5.19.0-46-generic-x86_64-with-glibc2.31 - Python version: 3.11.4 - Huggingface_hub version: 0.15.1 - Safetensors version: not installed - PyTorch version (GPU?): 2.0.1 (True) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?...
07-28-2023 02:34:22
07-28-2023 02:34:22
solved
transformers
25,156
open
Mask2Former Model Doesn't Move to GPU
### System Info transformers version: 4.31.0 (same bug occurs until version 4.27.0) pytorch 2.0.1+cu118 (same bug occurs with cu117) python: python 3.10 systems: NVIDIA RTX 3090 CUDA 12.0 ### Who can help? @amyeroberts @sgugger ### Information - [ ] The official example scripts - [X] My own modified scripts ...
07-28-2023 00:57:33
07-28-2023 00:57:33
Hi @chokevin8 Thank you for reporting. Could you provide a self-contained code snippet so the reproduction of the error is direct. Also you can enclose the error log in a block like the following \`\`\`bash error log ... \`\`\` to make it easier to read. Thank you in advance 🤗
transformers
25,155
open
torch compile changes model output in half precision
### System Info - `transformers` version: 4.31.0 - Platform: Linux-5.15.0-1034-oracle-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.15.1 - Safetensors version: 0.3.1 - Accelerate version: 0.20.3 - Accelerate config: not found - PyTorch version (GPU?): 2.0.0+cu117 (True) - Tenso...
07-27-2023 21:58:52
07-27-2023 21:58:52
That seems like an issue for PyTorch more than Transformers :-) Also note that there is a special order for context manager autocast and compiled model to respect (can't remember right now) which also may be the cause.
transformers
25,154
closed
`Pipeline.forward()` possibility to place `model_outputs` on GPU
### Feature request In `transformers.pipelines.base.py` (line 1035): `model_outputs = self._ensure_tensor_on_device(model_outputs, device=torch.device("cpu"))` Is it possible to add a new argument that decides whether `model_outputs` should be placed on `self.device` instead of `torch.device("cpu")`? ### Mo...
07-27-2023 20:39:29
07-27-2023 20:39:29
`pipeline` is only a wrapper around the model and preprocessing class for quick demos. To customize things more to your needs, you should use those classes independently as you need :-)<|||||>Thanks for the feedback @sgugger! I will keep customizing it then 😄
transformers
25,153
closed
Add new model: GeoLM
# What does this PR do? Add a new model called **GeoLM** into the Transformer library. GeoLM is a language model based on BERT that facilitates **geospatial understanding** in NL documents. It is pretrained on world-wide OpenStreetMap (OSM), WikiData and Wikipedia data, and can be adapted to various geospatial relat...
07-27-2023 19:09:54
07-27-2023 19:09:54
This PR contains redundant commits and failed test cases. I will fix them and create a new PR later.
transformers
25,152
open
Model is not compiled when using `torch_compile=True` on a machine with multiple GPUs
### System Info - `transformers` version: 4.31.0 - Platform: Linux-4.14.318-241.531.amzn2.x86_64-x86_64-with-glibc2.31 - Python version: 3.10.12 - Huggingface_hub version: 0.16.4 - Safetensors version: 0.3.1 - Accelerate version: 0.21.0 - Accelerate config: not found - PyTorch version (GPU?): 2.0.1+cu117 (Tr...
07-27-2023 18:56:20
07-27-2023 18:56:20
cc @muellerzr
transformers
25,151
open
Correct Falcon code in github does not match Falcon's checkpoint
### System Info Transformers version: 4.31.0 ### Who can help? @ArthurZucker @younesbelkada @Rocketknight1 ### Information - [X] The official example scripts - [ ] My own modified scripts ### Tasks - [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...) - [ ] My own task or datas...
07-27-2023 17:15:30
07-27-2023 17:15:30
The Falcon model inside Transformers is not ready to be used yet and is not compatible with the online checkpoint. To make the online checkpoints compatible with Transformer, we need to do some changes in the model repo that will break its integration with text-generation-inference. We are waiting for the new version o...
transformers
25,150
open
Update modeling_gpt2.py
Changed the declaration order in __ init __ so it is aligned with operational order. As consequence, __ repr __ method is now also aligned with operational order # What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear ...
07-27-2023 16:25:12
07-27-2023 16:25:12
cc @ArthurZucker <|||||>Can you just run `make style`, maybe it will put it back? <|||||>The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25150). All of your documentation changes will be reflected on that endpoint.
transformers
25,149
closed
[`IDEFICS`] Fix idefics config refactor
# What does this PR do? Refactors the `IdeficsConfig` to match the configuration composition patterns of multimodal models on transformers original PR: https://github.com/huggingface/transformers/pull/24796 Summary of the changes - Removed the copy of `CLIPTextConfig`, `CLIPConfig` in `clip.py` as they wer...
07-27-2023 15:41:03
07-27-2023 15:41:03
_The documentation is not available anymore as the PR was closed or merged._
transformers
25,148
closed
Add new model in doc table of content
# What does this PR do? As requested by @stas00 , this PR makes sure that the `add-new-model-like` command adds the model in the doc table of content. Since we are using another model as a reference, we can simply add it to the same section as that base model.
07-27-2023 15:31:17
07-27-2023 15:31:17
_The documentation is not available anymore as the PR was closed or merged._
transformers
25,147
open
Add PromptTemplate and allow for default PromptTemplate in model configuration
### Feature request As a user, I want to be able to load a model and feed it my input in such a way that it matches the prompt template that it saw during training. I want to be able to load the default prompt with few lines of code and without having to look up how the model was trained. Additionally, I want to be ab...
07-27-2023 15:06:12
07-27-2023 15:06:12
cc @ArthurZucker <|||||>This is 100% needed!<|||||>Hey! Thanks for opening this. Not sure if you have seen this but we have the [`ConversationalPipeline` ](https://huggingface.co/docs/transformers/main_classes/pipelines#transformers.Conversation) along with the `Conversation` object, which can pretty easily handle conv...
transformers
25,146
closed
More `token` things
# What does this PR do? Fix #25141 A few places are missed in #25083 (I haven't work on the training example scripts)
07-27-2023 15:05:32
07-27-2023 15:05:32
_The documentation is not available anymore as the PR was closed or merged._
transformers
25,145
closed
LLAMA 2 Distributed Training Support
### Feature request LLAMA 2 support for `device_map=True` ### Motivation The current LLAMA 2 does not include support for `device_map=True`. ``` Traceback (most recent call last): File "/u/haob2/saliency4alce/salience_llama_ecco.py", line 38, in <module> output = lm.generate(text, generate=3, beam_size=1...
07-27-2023 14:56:22
07-27-2023 14:56:22
Without a code reproducer of the error you encounter, there is little we will be able to do to help.<|||||>Just figured it out. So after we set `device_map=True`, we can't move the model to a specific device using `model = model.to(device)`, because the model is already dynamically allocated on all available devices. ...
transformers
25,144
open
Having "RuntimeError: expected scalar type Half but found Char" on LLaMa-2 inference stage
### System Info Working on jupyter notebook of a docker Linux instance of A100 , Ubuntu, x86_64 ![image](https://github.com/huggingface/transformers/assets/55791584/67b33111-748a-49a4-aa28-2f2009884c4d) ### Who can help? @sgugger @muellerzr ### Information - [X] The official example scripts - [ ] My ...
07-27-2023 14:46:20
07-27-2023 14:46:20
cc @younesbelkada <|||||>Hmm I really think we should set that value (`config.pretraining_tp`) to 1 (at least when the model is quantized) for all models as it can introduce unexpected behaviour to users. We saw it introduced bugs with PEFT (that users currently overcome by forcing `config.pretraining_tp` to be equal t...
transformers
25,143
open
run_generation.py script does not work for most models
### System Info - `transformers` version: 4.32.0.dev0 - Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - Huggingface_hub version: 0.16.4 - Safetensors version: 0.3.1 - Accelerate version: not installed - Accelerate config: not found - PyTorch version (GPU?): 2.0.1+cu117 (False) -...
07-27-2023 14:12:48
07-27-2023 14:12:48
I'm not sure why you expect this command to work: you are passing `--model_name_or_path=xlnet` which is not a valid model identifier on the Hub (as the error clearly says). You need to pick an actual model, all xlnet variants are listed [here](https://huggingface.co/models?sort=trending&search=xlnet).<|||||>> I'm not s...
transformers
25,142
closed
Using Trainer with custom model caused dimension error
### System Info ``` - `transformers` version: 4.31.0 - Platform: Windows-10-10.0.19045-SP0 - Python version: 3.11.4 - Huggingface_hub version: 0.16.4 - Safetensors version: 0.3.1 - Accelerate version: 0.21.0 - Accelerate config: not found - PyTorch version (GPU?): 2.0.1+cu118 (True) - Tensorflow version ...
07-27-2023 14:00:32
07-27-2023 14:00:32
cc our trainer master @sgugger , but I think the best is to follow the standard output format (i.e. either tuple or dict)<|||||>This is communicated clearly on the [Trainer doc page](https://huggingface.co/docs/transformers/main_classes/trainer), scroll a bit to the big warning.<|||||>Thank you for pointing me to the d...
transformers
25,141
closed
use_auth_token deprecation in pipeline
### System Info I noticed that `pipeline` uses `use_auth_token` argument which raises `FutureWarning: The use_auth_token argument is deprecated and will be removed in v5 of Transformers.`. Replacing `use_auth_token=True` with `token=True` argument does not yet work in `pipeline` (will raise an error). Sys Info...
07-27-2023 13:49:24
07-27-2023 13:49:24
Thanks for the report! cc @ydshieh Looks like it comes from the PR from yesterday.<|||||>Thanks for reporting, I will work on this. Not very easy to hanlde this history it turns out 👀 <|||||>Hi @maxjeblick Could you share the full error log. So far I don't get error when using `token=True`. (For `generate_text =...
transformers
25,140
open
add docs TypicalLogitsWarper
# What does this PR do? Added some doc string to TypicalLogitsWarper with some examples as well. <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects...
07-27-2023 12:54:22
07-27-2023 12:54:22
@gante let me know the changes<|||||>You also need to run `make fixup` before your next commit, so that our CI becomes happy :D <|||||>The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25140). All of your documentation changes will be reflected on that endpoint.
transformers
25,139
open
Seq2SeqTrainer.prediction_step does not support model.generation_config.max_length to be null
### System Info Although it is recommended to use max_new_tokens instead of max_length, if we set max_length to None, in the model's generation config, then in the following lines, we will get a "TypeError: '<' not supported between instances of 'int' and 'NoneType'" In transformers/trainer_seq2seq.py:290-296 ```p...
07-27-2023 12:29:41
07-27-2023 12:29:41
cc @gante <|||||>Hi @antonioalegria -- your issue and suggested fix makes complete sense 👍 Would you like to open a PR with the fix?<|||||>Sure, I'll do it! Thanks!
transformers
25,138
closed
How to return detected language using whisper with asr pipeline?
### System Info - `transformers` version: 4.31.0 - Platform: Linux-5.15.0-67-generic-x86_64-with-glibc2.31 - Python version: 3.10.12 - Huggingface_hub version: 0.16.4 - Safetensors version: 0.3.1 - Accelerate version: not installed - Accelerate config: not found - PyTorch version (GPU?): 2.0.1 (False) - Tensor...
07-27-2023 10:51:31
07-27-2023 10:51:31
Probably the easiest here is to use the `processor` + `model` API: ```python from transformers import WhisperProcessor, WhisperForConditionalGeneration from datasets import load_dataset model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-tiny") processor = WhisperProcessor.from_pretrained("op...
transformers
25,137
closed
Incorrect backward pass in the four bits LLaMA 2 70B
### System Info This issue needs to be treated as a code review comment. ### Who can help? @TimDettmers @ArthurZucker @younesbelkada It seems that when `config.pretraining_tp` is greater than one, then the projections of the keys, queries, and values in the `LlamaAttention` implemented using `torch.nn.functiona...
07-27-2023 10:40:02
07-27-2023 10:40:02
Hi @noamwies For fine-tuning llama2 models that have `config.pretraining_tp>1` consider calling ```python model.config.pretraining_tp = 1 ``` Before training, make sure to use the main branch of `transformers` to include: https://github.com/huggingface/transformers/pull/24906 ```bash pip uninstall transf...
transformers
25,136
closed
fix delete all checkpoints when save_total_limit is set to 1
# What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this w...
07-27-2023 10:16:12
07-27-2023 10:16:12
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25136). All of your documentation changes will be reflected on that endpoint.
transformers
25,135
open
In assisted decoding, pass model_kwargs to model's forward call
# What does this PR do? Previously, assisted decoding would ignore any additional kwargs that it doesn't explicitly handle. This was inconsistent with other generation methods, which pass the model_kwargs through prepare_inputs_for_generation and forward the returned dict to the model's forward call. The prepare_...
07-27-2023 09:41:19
07-27-2023 09:41:19
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25135). All of your documentation changes will be reflected on that endpoint.<|||||>@gante This is ready to review now. Thanks in advance.
transformers
25,134
closed
Clarify 4/8 bit loading log message
If you enable 4-bit loading, you will get a message that the model is being loaded in 8-bit. This can be a tad confusing. This tiny PR simply distinguishes in the logging between 4-bit and 8-bit loading.
07-27-2023 08:45:38
07-27-2023 08:45:38
_The documentation is not available anymore as the PR was closed or merged._<|||||>cc @younesbelkada and @SunMarc<|||||>Thanks!
transformers
25,133
closed
make run_generation more generic for other devices
## What does this PR do? Currently, the example for text-generation is only available for cuda or cpu. This PR makes it work well on mps or npu devices. Verified on A100 and npu. Example usage: ``` python3 run_generation.py \ --model_type=gpt2 \ --model_name_or_path=gpt2 ``` Below are the output ...
07-27-2023 07:39:25
07-27-2023 07:39:25
_The documentation is not available anymore as the PR was closed or merged._<|||||>@muellerzr Hey there! I've addressed some code quality check warnings. Could you take a look at this PR? Thank you!<|||||>> Thanks! There's some errors in here we need to fix, and we can probably also improve the mixed precision to use a...
transformers
25,132
open
Fine tuning TrOCR on 22 Indian Languages
Yeah that definitely will change behaviour. If you check ```python from transformers import TrOCRProcessor, VisionEncoderDecoderModel processor = TrOCRProcessor.from_pretrained("microsoft/trocr-base-stage1") model = VisionEncoderDecoderModel.from_pretrained("microsoft/trocr-base-stage1") print(...
07-27-2023 07:27:45
07-27-2023 07:27:45
@AnustupOCR This question is better to be on [Hugging Face Forum](https://discuss.huggingface.co/). The issue page here is for bug reporting and feature requests. ------------------- However, it makes sense to try `decoder_start_token_id=2` but monitoring the generation results earlier (not to wait until 3 ep...
transformers
25,131
closed
[`T5/LlamaTokenizer`] default legacy to `None` to not always warn
# What does this PR do? In a follow up to the patch that introduce the `legacy` argument #24622, this makes sure people are warn if the `legacy` is not set. Since online models were not changed, this does not really change much!
07-27-2023 07:17:48
07-27-2023 07:17:48
_The documentation is not available anymore as the PR was closed or merged._<|||||>Excellent - thank you for improving this feature, Arthur!
transformers
25,130
open
an inplace operation preventing TorchDistributor training
### System Info databricks ### Who can help? @ArthurZucker @younesbelkada Hi team, I got an error message by using TorchDistributor. I have checked in the class BertEmbeddings (url as below), line 238, embeddings += position_embeddings is an inplace operation, would you be able to change to embedd...
07-27-2023 05:28:20
07-27-2023 05:28:20
I would be very surprised if this famous `BERT` model has such issue. Could you provide the system environment like pytorch version. You can run the command `transformers-cli env` and copy-paste its output.<|||||>Actually @ydshieh I think this is pretty valid, and we have a bunch of issues with `inplace operation...
transformers
25,129
closed
Delete all checkpoints when set save_total_limit=1
### System Info - `transformers` version: 4.31.0 - Platform: Linux-3.10.0-1160.el7.x86_64-x86_64-with-glibc2.27 - Python version: 3.11.4 - Huggingface_hub version: 0.16.4 - Safetensors version: 0.3.1 - Accelerate version: 0.21.0 - Accelerate config: not found - PyTorch version (GPU?): 2.0.1 (True) - Tenso...
07-27-2023 03:57:33
07-27-2023 03:57:33
Hi @Pbihao ! Thank you a lot of reporting this issue. I can confirm it. Would you like to open a PR to help us fixing this 🤗 ? <|||||>Yeah, I have submitted the PR #25136 . Many thanks.
transformers
25,128
closed
make run_generation more generic for other devices
## What does this PR do? Currently, the example for text-generation is only available for cuda or cpu. This PR makes it work well on mps or npu devices. Verified on A100 and npu. Example usage: ``` python3 run_generation.py \ --model_type=gpt2 \ --model_name_or_path=gpt2 ``` Below are the output ...
07-27-2023 03:34:20
07-27-2023 03:34:20
_The documentation is not available anymore as the PR was closed or merged._
transformers
25,127
open
Trainer explodes with multiple validation sets used
### System Info - `transformers` version: 4.32.0.dev0 - Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.35 - Python version: 3.11.4 - Huggingface_hub version: 0.15.1 - Safetensors version: 0.3.1 - Accelerate version: 0.22.0.dev0 - Accelerate config: not found - PyTorch version (GPU?): 2.0.1 (True) - Tens...
07-27-2023 01:11:29
07-27-2023 01:11:29
Yes, multiple evaluation datasets are not supported in a notebook env, that is a known issue.<|||||>Thank you, Sylvain! 🙂 Didn't know that! Appreciate your reply, will close this now.<|||||>Ah ah you don't need to close it ;-) It's not been high-priority for us but we should fix it at some point.<|||||>Ok, sorry Sylva...
transformers
25,126
closed
[setup] fix min isort requirements
the current isort min version requirement doesn't match CI's reality even with isort 5.10.1 `make style` leads to modified code which doesn't match CI. I tested that 5.12 syncs with CI.
07-27-2023 00:40:02
07-27-2023 00:40:02
no, actually that didn't help :(<|||||>The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25126). All of your documentation changes will be reflected on that endpoint.
transformers
25,125
closed
[DOCS] Add example and modified docs of EtaLogitsWarper
# What does this PR do? See #24783 Added example to EtaLogitsWarper and also modifed its docstrings to make it more understandable ## Before submitting - [x] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case). - [x] Did you read the [contributor guideline](https:/...
07-27-2023 00:20:53
07-27-2023 00:20:53
@ashishthomaschempolil thank you for iterating 🤗 <|||||>_The documentation is not available anymore as the PR was closed or merged._
transformers
25,124
closed
added compiled model support for inference
# What does this PR do? Adds support for torch.compile-ed models in pipelines. Basically, you cannot run torch.compile-ed model under `torch.inference_mode()` context and should use `torch.no_grad` instead Examples: <img width="1004" alt="image" src="https://github.com/huggingface/transformers/assets/226634...
07-26-2023 20:43:05
07-26-2023 20:43:05
_The documentation is not available anymore as the PR was closed or merged._
transformers
25,123
open
Add Vocos model
### Model description Vocos is a Fourier-based neural vocoder for audio synthesis. According to its [paper](https://arxiv.org/pdf/2306.00814.pdf), Vocos constantly outperforms [HifiGan](https://huggingface.co/docs/transformers/main/en/model_doc/speecht5#transformers.SpeechT5HifiGan), has 13.5M params and is signifi...
07-26-2023 17:20:17
07-26-2023 17:20:17
transformers
25,122
closed
Move center_crop to BaseImageProcessor
# What does this PR do? Moves center_crop to BaseImageProcessor as the logic is the same for almost all models' image processors (except [bridgetower](https://github.com/huggingface/transformers/blob/659829b6ae558dd2e178462a797bf8b1a749f070/src/transformers/models/bridgetower/image_processing_bridgetower.py#L229) an...
07-26-2023 16:50:42
07-26-2023 16:50:42
_The documentation is not available anymore as the PR was closed or merged._
transformers
25,121
open
Add copied from for image processor methods
# What does this PR do? Adds `# Copied from` headers to shared image processor methods to ensure any updates to e.g. docstrings are propogated across. This mainly applies to the methods resize, center_crop and rescale. This is in part to prepare for any future adaptations to make handling of images with differen...
07-26-2023 15:49:34
07-26-2023 15:49:34
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25121). All of your documentation changes will be reflected on that endpoint.
transformers
25,120
closed
Fix `.push_to_hub` and cleanup `get_full_repo_name` usage
A few (vaguely) related changes in this PR. The main goal was to fix a bug when `.push_to_hub` is used with a repo_id in the form `"organization/repo_name"` that is also a local working directory. The organization gets removed which pushes the model to `"username/repo_name"` instead of under the organization. This bug ...
07-26-2023 15:20:23
07-26-2023 15:20:23
_The documentation is not available anymore as the PR was closed or merged._<|||||>Thanks for the review @ydshieh. I added some comments and fix a bug where token was not used (well done finding this one! :wink:). So I think we're good to go now. I'll merge the PR once CI is green :) <|||||>@Wauplin Thanks for the upda...
transformers
25,119
closed
Support End LR for Cosine LR Scheduler
### Feature request Customize the end learning rate of a cosine LR scheduler, as a non-zero end lr is commonly used now (e.g., LLaMA-2 use 10% of peak lr as end lr). ![image](https://github.com/huggingface/transformers/assets/55196500/4a07777f-968c-47da-b836-0f84dfd07a4d) ### Motivation non-zero end lr is commo...
07-26-2023 14:50:49
07-26-2023 14:50:49
You can pass along your custom scheduler to the `Trainer` :-)<|||||>OK, Thank you.
transformers
25,118
closed
Fix ViT docstring regarding default dropout values.
# What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this w...
07-26-2023 14:49:28
07-26-2023 14:49:28
Related to https://github.com/huggingface/transformers/issues/25108 @ydshieh <|||||>The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25118). All of your documentation changes will be reflected on that endpoint.
transformers
25,117
closed
EsmForMaskedLM no performance gain from batch processing
### System Info Transformers version: 4.30.2 Python version: 3.9.16 This occurs on both: MacBook Pro M2: MacOS 13.2.1 (22D68), ran using mps AND Debian 4.19.171-2 x86_64 GNU/Linux, ran using gpu ### Who can help? @ArthurZucker and @younesbelkada ### Information - [X] The official example scripts - [ ] My ow...
07-26-2023 14:42:05
07-26-2023 14:42:05
When I run a profiler it seems there is a bottleneck in the `apply_rotary_pos_emb` function called from the ESM sequence embedding. It could be that this is such a large bottle neck, that changing the batch size almost has no effect.<|||||>cc @Rocketknight1 <|||||>Hi It would be good to provide a full code snippet. ...
transformers
25,116
closed
[`MptConfig`] support from pretrained args
# What does this PR do? Adds a setter for `attn_config` to allow passing dict when initializing for backward compatibility Fixes https://github.com/huggingface/transformers/issues/25114
07-26-2023 14:20:48
07-26-2023 14:20:48
_The documentation is not available anymore as the PR was closed or merged._<|||||>cc @sgugger
transformers
25,115
closed
Fix beam search to sample at least 1 non eos token (#25103)
# What does this PR do? <!-- Congratulations! You've made it this far! You're not quite done yet though. Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution. Then, please replace this w...
07-26-2023 13:29:44
07-26-2023 13:29:44
done<|||||>ok now done :) sorry for all the force pushes I just wasn't sure how you guys merge so I preferred to keep 1 clean commit<|||||>> sorry for all the force pushes I just wasn't sure how you guys merge so I preferred to keep 1 clean commit @yonigottesman no worries, we squash before merging ;)<|||||>_The d...
transformers
25,114
closed
MptForCausalLM.from_pretrained gives error 'dict' object has no attribute 'softmax_scale'
### System Info Creating model MPT: ``` model = MptForCausalLM.from_pretrained( model_args.model_name_or_path, cache_dir=training_args.cache_dir, torch_dtype=torch.bfloat16, use_cache=False, init_device=f"cuda:{local_rank}", attn_config=dict(attn_impl="flas...
07-26-2023 13:05:54
07-26-2023 13:05:54
cc @younesbelkada and @ArthurZucker <|||||>Hey! Thanks for reporting. Indeed this does not work as the `attn_config` object does not seem to get converted to a `MptAttentionConfig` object. The `MptAttention` still needs the full config. Will open a PR to fix this as I guess this was previously working! <|||||>It is n...
transformers
25,113
closed
Fix past CI after #24334
# What does this PR do? Fix dtype issue in past CI (pytorch 1.11 and 1.10) after #24334 cc @gante
07-26-2023 12:53:26
07-26-2023 12:53:26
@ydshieh thank you for fixing it 🙏 <|||||>_The documentation is not available anymore as the PR was closed or merged._
transformers
25,112
closed
`Gradient clipping` function is not compatible with upgrade
### System Info `Gradient clipping` function is not compatible with upgrade. transformers4.28.1: ![image](https://github.com/huggingface/transformers/assets/39549453/52744be1-ebaf-4259-aacd-438e495bf9d2) Transformers4.30.2: ![image](https://github.com/huggingface/transformers/assets/39549453/b8b9fe7a-ca3e-4b...
07-26-2023 12:06:21
07-26-2023 12:06:21
The `unscale_gradients` is done in the first screenshot a couple of lines above. I'm not sure what it is you are reporting as a bug.<|||||>> unscale_gradients I run the same code in the same environment, the difference is the version of transformers. transformers4.28.1 running normally ![Pasted Graphic 3](https:...
transformers
25,111
open
ValueError: Connection error, and we cannot find the requested files in the cached path
### System Info transformers version: 4.8.1 python version: 3.8 platform: Ubuntu 20.04.1 LTS ### Who can help? @ArthurZucker, @younesbelkada ### Information - [ ] The official example scripts - [X] My own modified scripts ### Tasks - [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD...
07-26-2023 11:54:32
07-26-2023 11:54:32
Hey! Pretty sure this was just a temporary failure! It is back up for me! <|||||>Thanks for your reply. But the problem still exists for me. I debugged the code of Transformers 4.8.1 and found there is an variable called `vocab_files` in PreTrainedTokenizerBase.from_pretrained method. `vocab_files` contains {'vocab_...
transformers
25,110
open
Feature request: Adding einops as a Dependency
### Feature request I propose that the einops library be added as a dependency in the HuggingFace Transformers library. einops (Einstein Notation Operations) is a Python library that provides a more expressive language for tensor operations. This would offer highly readable and maintainable code for complex tensor res...
07-26-2023 11:38:28
07-26-2023 11:38:28
There is actually a (recent) discussion > There have been lots of discussions on this in the past, the TLDR is that we aren't supporting it cause it causes issues with things like ONNX and the approach is more > just re-wrote that part in pure pytorch, <|||||>For me there is no reason to add a dependency w...
transformers
25,109
closed
🚨🚨🚨Change default from `adamw_hf` to `adamw_torch` 🚨🚨🚨
# What does this PR do? This PR changes the default from `adamw_hf` to `adamw_torch`, as noted in https://github.com/huggingface/transformers/issues/25006 which fixes some breaking issues. Note that https://github.com/huggingface/transformers/issues/22141 still needs to be fulfilled once torch 2.1.0 is released (som...
07-26-2023 11:33:25
07-26-2023 11:33:25
_The documentation is not available anymore as the PR was closed or merged._
transformers
25,108
closed
Wrong default values according to docstrings?
https://github.com/huggingface/transformers/blob/d941f07a4e3bc7b61b7afbd25d6e2e8427fccc6d/src/transformers/models/vit/configuration_vit.py#L100 https://github.com/huggingface/transformers/blob/d941f07a4e3bc7b61b7afbd25d6e2e8427fccc6d/src/transformers/models/vit/configuration_vit.py#L101
07-26-2023 11:14:00
07-26-2023 11:14:00
Hi @ebezzam I am not sure I understand the question. Could you describe it more precisely? Thanks.<|||||>Hi @ydshieh thank you for your quick response. The docstring of [ViTConfig](https://github.com/huggingface/transformers/blob/d941f07a4e3bc7b61b7afbd25d6e2e8427fccc6d/src/transformers/models/vit/configuration_...
transformers
25,107
open
add util for ram efficient loading of model when using fsdp
# What does this PR do? 1. Fixes an issue explained in https://github.com/pytorch/pytorch/issues/105840 when using FSDP for training very large models. Should be merged after https://github.com/huggingface/accelerate/pull/1777 Currently, when using FSDP, the model is loaded for each of the N processes completely on...
07-26-2023 10:50:49
07-26-2023 10:50:49
The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_25107). All of your documentation changes will be reflected on that endpoint.
transformers
25,106
closed
Fix `PvtModelIntegrationTest::test_inference_fp16`
# What does this PR do? Failing ```bash FAILED tests/models/pvt/test_modeling_pvt.py::PvtModelIntegrationTest::test_inference_fp16 - ValueError: PvtForImageClassification does not support `device_map='auto'`. To implement support, the modelclass needs to implement the `_no_split_modules` attribute. ``` A fix...
07-26-2023 10:12:30
07-26-2023 10:12:30
_The documentation is not available anymore as the PR was closed or merged._