url
stringlengths
62
66
repository_url
stringclasses
1 value
labels_url
stringlengths
76
80
comments_url
stringlengths
71
75
events_url
stringlengths
69
73
html_url
stringlengths
50
56
id
int64
377M
2.15B
node_id
stringlengths
18
32
number
int64
1
29.2k
title
stringlengths
1
487
user
dict
labels
list
state
stringclasses
2 values
locked
bool
2 classes
assignee
dict
assignees
list
comments
sequence
created_at
int64
1.54k
1.71k
updated_at
int64
1.54k
1.71k
closed_at
int64
1.54k
1.71k
author_association
stringclasses
4 values
active_lock_reason
stringclasses
2 values
body
stringlengths
0
234k
reactions
dict
timeline_url
stringlengths
71
75
state_reason
stringclasses
3 values
draft
bool
2 classes
pull_request
dict
https://api.github.com/repos/huggingface/transformers/issues/4312
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4312/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4312/comments
https://api.github.com/repos/huggingface/transformers/issues/4312/events
https://github.com/huggingface/transformers/issues/4312
616,613,657
MDU6SXNzdWU2MTY2MTM2NTc=
4,312
how can I make BERT word embedding faster?
{ "login": "shubhamk16", "id": 46631180, "node_id": "MDQ6VXNlcjQ2NjMxMTgw", "avatar_url": "https://avatars.githubusercontent.com/u/46631180?v=4", "gravatar_id": "", "url": "https://api.github.com/users/shubhamk16", "html_url": "https://github.com/shubhamk16", "followers_url": "https://api.github.com/users/shubhamk16/followers", "following_url": "https://api.github.com/users/shubhamk16/following{/other_user}", "gists_url": "https://api.github.com/users/shubhamk16/gists{/gist_id}", "starred_url": "https://api.github.com/users/shubhamk16/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/shubhamk16/subscriptions", "organizations_url": "https://api.github.com/users/shubhamk16/orgs", "repos_url": "https://api.github.com/users/shubhamk16/repos", "events_url": "https://api.github.com/users/shubhamk16/events{/privacy}", "received_events_url": "https://api.github.com/users/shubhamk16/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "It seems you're not actually putting anything on GPU. You need to call `bertModel.to(device)` and `input_ids.to(device)`.\r\n\r\nThe BERT model is much larger than GloVe, however, so you'll never get the same speed.", "Thank you @LysandreJik. It actually increases speed but not that much.\r\nIs there any model which is better than Glove and also fast in embedding like Glove.", "The fatest model we have in the library that I know of would be `DistilBERT`, which would still be slower than GloVe, but faster than BERT.\r\n\r\nGloVe and transformer models are very different concepts, and solve different problems, hence why transformer models are way bigger/slower.", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,595
1,595
NONE
null
Hello guys, I have a code in which words get embedded with **Glove Embedding** for the number of iterations. model.word_emb= utils.load_word_emb(args.glove_embed_path) a =time.time() w = "Transformer" X = model.word_emb.get(w, model.word_emb['unk']) b =time.time() print(b-a) and for each word glove embedding takes 0.000275 sec. Now I want to shift with BERT embedding but the problem is, from transformers import BertModel, BertTokenizer tokenizer = BertTokenizer.from_pretrained('bert-base-uncased', do_lower_case=True) bertModel = BertModel.from_pretrained('bert-base-uncased') device = torch.device("cuda") def bert_embedding(text): input_ids = (torch.tensor(tokenizer.encode(text)).unsqueeze(0)) outputs = bertModel(input_ids) return (outputs[0][0][1]) a =time.time() w = "Transformers" X = bert_embedding(w) b =time.time() print(b-a) it takes around 0.04235 sec which is **154 times** slower than Glove how should I use Bert but with a speed of glove embedding? Thank you so much in advance!
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4312/reactions", "total_count": 2, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 2 }
https://api.github.com/repos/huggingface/transformers/issues/4312/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4311
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4311/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4311/comments
https://api.github.com/repos/huggingface/transformers/issues/4311/events
https://github.com/huggingface/transformers/issues/4311
616,599,169
MDU6SXNzdWU2MTY1OTkxNjk=
4,311
RobertaForQuestionAnsweringModel
{ "login": "krishnapriya-18", "id": 48817796, "node_id": "MDQ6VXNlcjQ4ODE3Nzk2", "avatar_url": "https://avatars.githubusercontent.com/u/48817796?v=4", "gravatar_id": "", "url": "https://api.github.com/users/krishnapriya-18", "html_url": "https://github.com/krishnapriya-18", "followers_url": "https://api.github.com/users/krishnapriya-18/followers", "following_url": "https://api.github.com/users/krishnapriya-18/following{/other_user}", "gists_url": "https://api.github.com/users/krishnapriya-18/gists{/gist_id}", "starred_url": "https://api.github.com/users/krishnapriya-18/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/krishnapriya-18/subscriptions", "organizations_url": "https://api.github.com/users/krishnapriya-18/orgs", "repos_url": "https://api.github.com/users/krishnapriya-18/repos", "events_url": "https://api.github.com/users/krishnapriya-18/events{/privacy}", "received_events_url": "https://api.github.com/users/krishnapriya-18/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "Pull request welcome!" ]
1,589
1,589
1,589
NONE
null
There is no ready to use RobertaForQuestionAnsweringModel Class in transformers. Please add it as you have done for other models.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4311/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4311/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4310
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4310/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4310/comments
https://api.github.com/repos/huggingface/transformers/issues/4310/events
https://github.com/huggingface/transformers/issues/4310
616,556,297
MDU6SXNzdWU2MTY1NTYyOTc=
4,310
MobileBert form google-research added
{ "login": "mrm8488", "id": 3653789, "node_id": "MDQ6VXNlcjM2NTM3ODk=", "avatar_url": "https://avatars.githubusercontent.com/u/3653789?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mrm8488", "html_url": "https://github.com/mrm8488", "followers_url": "https://api.github.com/users/mrm8488/followers", "following_url": "https://api.github.com/users/mrm8488/following{/other_user}", "gists_url": "https://api.github.com/users/mrm8488/gists{/gist_id}", "starred_url": "https://api.github.com/users/mrm8488/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mrm8488/subscriptions", "organizations_url": "https://api.github.com/users/mrm8488/orgs", "repos_url": "https://api.github.com/users/mrm8488/repos", "events_url": "https://api.github.com/users/mrm8488/events{/privacy}", "received_events_url": "https://api.github.com/users/mrm8488/received_events", "type": "User", "site_admin": false }
[ { "id": 1843244711, "node_id": "MDU6TGFiZWwxODQzMjQ0NzEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/New%20model", "name": "New model", "color": "fbca04", "default": false, "description": "" } ]
closed
false
null
[]
[ "Will close this to track this at more general #4185", "Please the \" checkpoint\" file to reset the path to \"mobilebert_variables.ckpt\" \r\nThis can solved my issue.\r\n" ]
1,589
1,610
1,589
CONTRIBUTOR
null
# 🌟 New model addition ## Model description [MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices](https://arxiv.org/abs/2004.02984) Repo [link](https://github.com/google-research/google-research/tree/master/mobilebert) ## Open source status * [x] Uploaded to HF model hub [bert_config.json](https://s3.amazonaws.com/models.huggingface.co/bert/mrm8488/MobileBERT/bert_config.json) [vocab.txt](https://s3.amazonaws.com/models.huggingface.co/bert/mrm8488/MobileBERT/vocab.txt) [mobilebert_variables.ckpt.data-00000-of-00001](https://s3.amazonaws.com/models.huggingface.co/bert/mrm8488/MobileBERT/mobilebert_variables.ckpt.data-00000-of-00001) [mobilebert_variables.ckpt.index](https://s3.amazonaws.com/models.huggingface.co/bert/mrm8488/MobileBERT/mobilebert_variables.ckpt.index) [checkpoint](https://s3.amazonaws.com/models.huggingface.co/bert/mrm8488/MobileBERT/checkpoint) * [ ] Convert model checkpoint to pytorch (or Keras h5, savedModel) The [script](https://github.com/huggingface/transformers/blob/master/src/transformers/convert_bert_original_tf_checkpoint_to_pytorch.py) to convert BERT models to Pytorch fails. Based on the error output the error comes from modeling [script](https://github.com/huggingface/transformers/blob/master/src/transformers/modeling_bert.py): ``` File "/usr/local/lib/python3.6/dist-packages/transformers/modeling_bert.py", line 77, in load_tf_weights_in_bert ``` Whole error: ``` INFO:transformers.modeling_bert:Converting TensorFlow checkpoint from /content/mobilebert Traceback (most recent call last): File "/content/convert_bert_original_tf_checkpoint_to_pytorch.py", line 61, in <module> convert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.bert_config_file, args.pytorch_dump_path) File "/content/convert_bert_original_tf_checkpoint_to_pytorch.py", line 36, in convert_tf_checkpoint_to_pytorch load_tf_weights_in_bert(model, config, tf_checkpoint_path) File "/usr/local/lib/python3.6/dist-packages/transformers/modeling_bert.py", line 77, in load_tf_weights_in_bert init_vars = tf.train.list_variables(tf_path) File "/tensorflow-1.15.2/python3.6/tensorflow_core/python/training/checkpoint_utils.py", line 97, in list_variables reader = load_checkpoint(ckpt_dir_or_file) File "/tensorflow-1.15.2/python3.6/tensorflow_core/python/training/checkpoint_utils.py", line 62, in load_checkpoint filename = _get_checkpoint_filename(ckpt_dir_or_file) File "/tensorflow-1.15.2/python3.6/tensorflow_core/python/training/checkpoint_utils.py", line 384, in _get_checkpoint_filename return checkpoint_management.latest_checkpoint(ckpt_dir_or_file) File "/tensorflow-1.15.2/python3.6/tensorflow_core/python/training/checkpoint_management.py", line 341, in latest_checkpoint if file_io.get_matching_files(v2_path) or file_io.get_matching_files( File "/tensorflow-1.15.2/python3.6/tensorflow_core/python/lib/io/file_io.py", line 363, in get_matching_files return get_matching_files_v2(filename) File "/tensorflow-1.15.2/python3.6/tensorflow_core/python/lib/io/file_io.py", line 384, in get_matching_files_v2 compat.as_bytes(pattern)) tensorflow.python.framework.errors_impl.NotFoundError: /cns/tp-d/home/tensorflow-tpus/hongkuny/bert/pretrained_models/uncased_L-24_H-128_B-512_A-4_F-4_OPT/oss; No such file or directory ``` Based on last line of the error log: ``` tensorflow.python.framework.errors_impl.NotFoundError: /cns/tp-d/home/tensorflow-tpus/hongkuny/bert/pretrained_models/uncased_L-24_H-128_B-512_A-4_F-4_OPT/oss; No such file or directory ``` It seems TF keep a kind for directory with the paths of their *availiable* models and this one is not there yet. But maybe we can fix it using the modeling script in the repo of MobileBert: https://github.com/google-research/google-research/blob/master/mobilebert/modeling.py Thougths?
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4310/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4310/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4309
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4309/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4309/comments
https://api.github.com/repos/huggingface/transformers/issues/4309/events
https://github.com/huggingface/transformers/issues/4309
616,536,041
MDU6SXNzdWU2MTY1MzYwNDE=
4,309
Finetuning error: RuntimeError: Error(s) in loading state_dict for GPT2LMHeadModel: Missing key(s) in state_dict: “transformer.h.0.attn.masked_bias”, “transformer.h.1.attn.masked_bias”
{ "login": "kiranikram", "id": 45267484, "node_id": "MDQ6VXNlcjQ1MjY3NDg0", "avatar_url": "https://avatars.githubusercontent.com/u/45267484?v=4", "gravatar_id": "", "url": "https://api.github.com/users/kiranikram", "html_url": "https://github.com/kiranikram", "followers_url": "https://api.github.com/users/kiranikram/followers", "following_url": "https://api.github.com/users/kiranikram/following{/other_user}", "gists_url": "https://api.github.com/users/kiranikram/gists{/gist_id}", "starred_url": "https://api.github.com/users/kiranikram/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kiranikram/subscriptions", "organizations_url": "https://api.github.com/users/kiranikram/orgs", "repos_url": "https://api.github.com/users/kiranikram/repos", "events_url": "https://api.github.com/users/kiranikram/events{/privacy}", "received_events_url": "https://api.github.com/users/kiranikram/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "I think we're missing some info here, can you add your complete code snippet to the issue's title? \r\n\r\n### 🤣🤣 \r\n\r\nYou can even add some binary data in there for good measure.\r\n\r\nHehe I'm just kidding :trollface: ", "Managed: I just didn’t account for the May 7 transformers release! \n\nSent from my iPhone\n\n> On 12 May 2020, at 2:08 PM, Julien Chaumond <[email protected]> wrote:\n> \n> \n> I think we're missing some info here, can you add your complete code snippet to the issue's title?\n> \n> 🤣🤣\n> \n> You can even add some binary data in there for good measure.\n> \n> Hehe I'm just kidding \n> \n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub, or unsubscribe.\n", "The same issue in Colab. I use DialoGPT repo but issue is the same", "Help, please . Anyone. I can't load on other devices. I have copied the model from the device where it was trained on GPU, now I cannot load on other device with CPU.", "It's hard to help with this much information. Can you open a new issue, respecting the template, letting us know what's your issue?", "https://github.com/huggingface/transformers/commit/05deb52dc170226fcad899c240ee9568986d8d5a#diff-8530ad4c95b70580d10d594b7411a8be seemed to break this pretrained model, which was last modified on February 18. There masked_bias was introduced. Try reverting to a version before that, like cec3cdd." ]
1,589
1,590
1,589
NONE
null
# ❓ Questions & Help <!-- The GitHub issue tracker is primarly intended for bugs, feature requests, new models and benchmarks, and migration questions. For all other questions, we direct you to Stack Overflow (SO) where a whole community of PyTorch and Tensorflow enthusiast can help you out. Make sure to tag your question with the right deep learning framework as well as the huggingface-transformers tag: https://stackoverflow.com/questions/tagged/huggingface-transformers If your question wasn't answered after a period of time on Stack Overflow, you can always open a question on GitHub. You should then link to the SO question that you posted. --> ## Details <!-- Description of your issue --> <!-- You should first ask your question on SO, and only if you didn't get an answer ask it here on GitHub. --> **A link to original question on Stack Overflow**:
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4309/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4309/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4308
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4308/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4308/comments
https://api.github.com/repos/huggingface/transformers/issues/4308/events
https://github.com/huggingface/transformers/issues/4308
616,517,287
MDU6SXNzdWU2MTY1MTcyODc=
4,308
MPNet: Masked and Permuted Pre-training for Language Understanding
{ "login": "RyanHuangNLP", "id": 49582480, "node_id": "MDQ6VXNlcjQ5NTgyNDgw", "avatar_url": "https://avatars.githubusercontent.com/u/49582480?v=4", "gravatar_id": "", "url": "https://api.github.com/users/RyanHuangNLP", "html_url": "https://github.com/RyanHuangNLP", "followers_url": "https://api.github.com/users/RyanHuangNLP/followers", "following_url": "https://api.github.com/users/RyanHuangNLP/following{/other_user}", "gists_url": "https://api.github.com/users/RyanHuangNLP/gists{/gist_id}", "starred_url": "https://api.github.com/users/RyanHuangNLP/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/RyanHuangNLP/subscriptions", "organizations_url": "https://api.github.com/users/RyanHuangNLP/orgs", "repos_url": "https://api.github.com/users/RyanHuangNLP/repos", "events_url": "https://api.github.com/users/RyanHuangNLP/events{/privacy}", "received_events_url": "https://api.github.com/users/RyanHuangNLP/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null }, { "id": 1843244711, "node_id": "MDU6TGFiZWwxODQzMjQ0NzEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/New%20model", "name": "New model", "color": "fbca04", "default": false, "description": "" } ]
closed
false
null
[]
[ "Hi huggingface/transformers,\r\n\r\nI am Xu Tan from Microsoft Research. Thanks for that you mentioned MPNet in huggingface/transformers repo.\r\n\r\nMPNet is an advanced pre-trained models for language understanding, which inherits the advantages of BERT and XLNet, while well address their problems. We have MPNet pre-trained models, codes (the version for huggingface/transformers) and downstream task results ready.\r\n\r\nHow can we proceed to incorporate MPNet into huggingface/transformers repo? Thanks very much!\r\n\r\n\r\nBest,\r\nXu\r\nFrom: RyanHuangNLP <[email protected]>\r\nSent: Tuesday, May 12, 2020 5:48 PM\r\nTo: huggingface/transformers <[email protected]>\r\nCc: Xu Tan <[email protected]>; Mention <[email protected]>\r\nSubject: [huggingface/transformers] MPNet: Masked and Permuted Pre-training for Language Understanding (#4308)\r\n\r\n🌟 New model addition\r\nModel description\r\n\r\nMPNet: Masked and Permuted Pre-training for Language Understanding<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Farxiv.org%2Fpdf%2F2004.09297.pdf&data=02%7C01%7CXu.Tan%40microsoft.com%7C36a49d494f604784087708d7f6598986%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248737639246486&sdata=%2BE5kPD%2F1nyY9bgRtqr%2FCFf2YzsI8E%2BcTzWX0gcUSnWs%3D&reserved=0>\r\nuse both Masked Language Model and Permuted Language Model\r\n\r\nOpen source status\r\n\r\n * [MPNet ] the model implementation is available: (https://github.com/microsoft/MPNet<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FMPNet&data=02%7C01%7CXu.Tan%40microsoft.com%7C36a49d494f604784087708d7f6598986%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248737639246486&sdata=%2Fp94TR%2BQVvRNdoio0kjL%2FjmGgtQb8SlcQouAnas8gmY%3D&reserved=0>)\r\n * [MPNet pretrain weight ] the model weights are available: (https://modelrelease.blob.core.windows.net/pre-training/MPNet/mpnet.example.pt<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmodelrelease.blob.core.windows.net%2Fpre-training%2FMPNet%2Fmpnet.example.pt&data=02%7C01%7CXu.Tan%40microsoft.com%7C36a49d494f604784087708d7f6598986%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248737639256488&sdata=F8O2da%2FYPXS8AjmIVt4D%2FOaNLOYmSVgfyICRQuHf0BI%3D&reserved=0>)\r\n * [@tobyoup<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftobyoup&data=02%7C01%7CXu.Tan%40microsoft.com%7C36a49d494f604784087708d7f6598986%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248737639266479&sdata=hJn0ZIEEzgukAII%2FtaXEl6ZmIt2jQqRwtSP2Hu1lujs%3D&reserved=0>@StillKeepTry ] who are the authors: (mention them, if possible by @gh-username<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fgh-username&data=02%7C01%7CXu.Tan%40microsoft.com%7C36a49d494f604784087708d7f6598986%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248737639266479&sdata=3ntmS0WjsV8DxOyrDyt7Qduc6jGMzU%2BfdcniizaYuLQ%3D&reserved=0>)\r\n\r\n—\r\nYou are receiving this because you were mentioned.\r\nReply to this email directly, view it on GitHub<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fhuggingface%2Ftransformers%2Fissues%2F4308&data=02%7C01%7CXu.Tan%40microsoft.com%7C36a49d494f604784087708d7f6598986%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248737639276475&sdata=t3iSTAMR54mEsK%2Blgc9pjxuYZmnYQcwJjtje%2BQ05yeU%3D&reserved=0>, or unsubscribe<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALQV7L4JWDDOBVHDVZYRCD3RRELMPANCNFSM4M6VMZPQ&data=02%7C01%7CXu.Tan%40microsoft.com%7C36a49d494f604784087708d7f6598986%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248737639276475&sdata=4496eTEWR5xHALKY9MGu6Aal%2Fx%2BU1dn87FkpASm72ME%3D&reserved=0>.\r\n", "+ RyanHuangNLP\r\n\r\nFrom: Xu Tan\r\nSent: Sunday, July 5, 2020 6:58 PM\r\nTo: huggingface/transformers <[email protected]>; huggingface/transformers <[email protected]>\r\nSubject: RE: [huggingface/transformers] MPNet: Masked and Permuted Pre-training for Language Understanding (#4308)\r\n\r\nHi huggingface/transformers,\r\n\r\nI am Xu Tan from Microsoft Research. Thanks for that you mentioned MPNet in huggingface/transformers repo.\r\n\r\nMPNet is an advanced pre-trained models for language understanding, which inherits the advantages of BERT and XLNet, while well address their problems. We have MPNet pre-trained models, codes (the version for huggingface/transformers) and downstream task results ready.\r\n\r\nHow can we proceed to incorporate MPNet into huggingface/transformers repo? Thanks very much!\r\n\r\n\r\nBest,\r\nXu\r\nFrom: RyanHuangNLP <[email protected]<mailto:[email protected]>>\r\nSent: Tuesday, May 12, 2020 5:48 PM\r\nTo: huggingface/transformers <[email protected]<mailto:[email protected]>>\r\nCc: Xu Tan <[email protected]<mailto:[email protected]>>; Mention <[email protected]<mailto:[email protected]>>\r\nSubject: [huggingface/transformers] MPNet: Masked and Permuted Pre-training for Language Understanding (#4308)\r\n\r\n🌟 New model addition\r\nModel description\r\n\r\nMPNet: Masked and Permuted Pre-training for Language Understanding<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Farxiv.org%2Fpdf%2F2004.09297.pdf&data=02%7C01%7CXu.Tan%40microsoft.com%7C36a49d494f604784087708d7f6598986%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248737639246486&sdata=%2BE5kPD%2F1nyY9bgRtqr%2FCFf2YzsI8E%2BcTzWX0gcUSnWs%3D&reserved=0>\r\nuse both Masked Language Model and Permuted Language Model\r\n\r\nOpen source status\r\n\r\n * [MPNet ] the model implementation is available: (https://github.com/microsoft/MPNet<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FMPNet&data=02%7C01%7CXu.Tan%40microsoft.com%7C36a49d494f604784087708d7f6598986%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248737639246486&sdata=%2Fp94TR%2BQVvRNdoio0kjL%2FjmGgtQb8SlcQouAnas8gmY%3D&reserved=0>)\r\n * [MPNet pretrain weight ] the model weights are available: (https://modelrelease.blob.core.windows.net/pre-training/MPNet/mpnet.example.pt<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmodelrelease.blob.core.windows.net%2Fpre-training%2FMPNet%2Fmpnet.example.pt&data=02%7C01%7CXu.Tan%40microsoft.com%7C36a49d494f604784087708d7f6598986%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248737639256488&sdata=F8O2da%2FYPXS8AjmIVt4D%2FOaNLOYmSVgfyICRQuHf0BI%3D&reserved=0>)\r\n * [@tobyoup<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftobyoup&data=02%7C01%7CXu.Tan%40microsoft.com%7C36a49d494f604784087708d7f6598986%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248737639266479&sdata=hJn0ZIEEzgukAII%2FtaXEl6ZmIt2jQqRwtSP2Hu1lujs%3D&reserved=0>@StillKeepTry ] who are the authors: (mention them, if possible by @gh-username<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fgh-username&data=02%7C01%7CXu.Tan%40microsoft.com%7C36a49d494f604784087708d7f6598986%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248737639266479&sdata=3ntmS0WjsV8DxOyrDyt7Qduc6jGMzU%2BfdcniizaYuLQ%3D&reserved=0>)\r\n\r\n—\r\nYou are receiving this because you were mentioned.\r\nReply to this email directly, view it on GitHub<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fhuggingface%2Ftransformers%2Fissues%2F4308&data=02%7C01%7CXu.Tan%40microsoft.com%7C36a49d494f604784087708d7f6598986%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248737639276475&sdata=t3iSTAMR54mEsK%2Blgc9pjxuYZmnYQcwJjtje%2BQ05yeU%3D&reserved=0>, or unsubscribe<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALQV7L4JWDDOBVHDVZYRCD3RRELMPANCNFSM4M6VMZPQ&data=02%7C01%7CXu.Tan%40microsoft.com%7C36a49d494f604784087708d7f6598986%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637248737639276475&sdata=4496eTEWR5xHALKY9MGu6Aal%2Fx%2BU1dn87FkpASm72ME%3D&reserved=0>.\r\n", "Hi @tobyoup, it's very cool that you want to contribute your architecture!\r\n\r\nYou can follow this [checklist](https://github.com/huggingface/transformers/tree/master/templates/adding_a_new_model) to add your model. Once you open a PR, we'll be very happy to help you finish the integration!", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n", "@tobyoup @LysandreJik Is there any update about MPNET in transformers?", "We are actively preparing the integration codes, and will be ready these weeks.", "@tobyoup Is MPNET. ready in transformers? Hello, any updates?", "@tobyoup @LysandreJik Is there any update about MPNET in transformers?", "~The PR for the MPNET integration has not seen any progress yet.~ @tobyoup, don't hesitate to ping us if you need help or pointers towards the integration.\r\n\r\nThere are ongoing efforts to implement MPNet on https://github.com/huggingface/transformers/pull/5804 by @StillKeepTry", "Thanks for the reminder! We are adapting the codes these days and we expect to give the first PR by this weekend.\r\n\r\nThanks\r\nXu\r\nFrom: Lysandre Debut <[email protected]>\r\nSent: Friday, November 13, 2020 1:27 AM\r\nTo: huggingface/transformers <[email protected]>\r\nCc: Xu Tan <[email protected]>; Mention <[email protected]>\r\nSubject: Re: [huggingface/transformers] MPNet: Masked and Permuted Pre-training for Language Understanding (#4308)\r\n\r\n\r\nThe PR for the MPNET integration has not seen any progress yet. @tobyoup<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftobyoup&data=04%7C01%7CXu.Tan%40microsoft.com%7C9c1b4ed7fdb847535a2908d887302e38%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637407988352073356%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Q2NWAAxvh5LXn6d24FW7Uy4jBfs2%2BsodWvfPY3F%2BZVc%3D&reserved=0>, don't hesitate to ping us if you need help or pointers towards the integration.\r\n\r\n—\r\nYou are receiving this because you were mentioned.\r\nReply to this email directly, view it on GitHub<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fhuggingface%2Ftransformers%2Fissues%2F4308%23issuecomment-726222432&data=04%7C01%7CXu.Tan%40microsoft.com%7C9c1b4ed7fdb847535a2908d887302e38%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637407988352073356%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=fnG9MzRgWBxG4tGKsoRJd0GCSHEH8AMvpNZFYNhOcJs%3D&reserved=0>, or unsubscribe<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALQV7L6OVO3TCAHLX3UDVVLSPQLGXANCNFSM4M6VMZPQ&data=04%7C01%7CXu.Tan%40microsoft.com%7C9c1b4ed7fdb847535a2908d887302e38%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637407988352083352%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=kFPFzyRHfpImvd55Kr33XodHoQ8HtMlT8LhC5WDf4qA%3D&reserved=0>.\r\n", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,611
1,611
NONE
null
# 🌟 New model addition ## Model description [MPNet: Masked and Permuted Pre-training for Language Understanding](https://arxiv.org/pdf/2004.09297.pdf) use both Masked Language Model and Permuted Language Model ## Open source status * [MPNet ] the model implementation is available: (https://github.com/microsoft/MPNet) * [MPNet pretrain weight ] the model weights are available: (https://modelrelease.blob.core.windows.net/pre-training/MPNet/mpnet.example.pt) * [@tobyoup@StillKeepTry ] who are the authors: (mention them, if possible by @gh-username)
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4308/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4308/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4307
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4307/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4307/comments
https://api.github.com/repos/huggingface/transformers/issues/4307/events
https://github.com/huggingface/transformers/issues/4307
616,488,022
MDU6SXNzdWU2MTY0ODgwMjI=
4,307
why Building wheel for tokenizers (PEP 517) ... error?
{ "login": "jerry1993-tech", "id": 26736518, "node_id": "MDQ6VXNlcjI2NzM2NTE4", "avatar_url": "https://avatars.githubusercontent.com/u/26736518?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jerry1993-tech", "html_url": "https://github.com/jerry1993-tech", "followers_url": "https://api.github.com/users/jerry1993-tech/followers", "following_url": "https://api.github.com/users/jerry1993-tech/following{/other_user}", "gists_url": "https://api.github.com/users/jerry1993-tech/gists{/gist_id}", "starred_url": "https://api.github.com/users/jerry1993-tech/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jerry1993-tech/subscriptions", "organizations_url": "https://api.github.com/users/jerry1993-tech/orgs", "repos_url": "https://api.github.com/users/jerry1993-tech/repos", "events_url": "https://api.github.com/users/jerry1993-tech/events{/privacy}", "received_events_url": "https://api.github.com/users/jerry1993-tech/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n", "i have this problem too , how did you resolve it?can you share your ideas?" ]
1,589
1,619
1,595
NONE
null
# ❓ Questions & Help <!-- The GitHub issue tracker is primarly intended for bugs, feature requests, new models and benchmarks, and migration questions. For all other questions, we direct you to Stack Overflow (SO) where a whole community of PyTorch and Tensorflow enthusiast can help you out. Make sure to tag your question with the right deep learning framework as well as the huggingface-transformers tag: https://stackoverflow.com/questions/tagged/huggingface-transformers If your question wasn't answered after a period of time on Stack Overflow, you can always open a question on GitHub. You should then link to the SO question that you posted. --> ## Details <!-- Description of your issue --> Building wheels for collected packages: tokenizers Building wheel for tokenizers (PEP 517) ... error ERROR: Command errored out with exit status 1: command: /Users/xuyingjie/venv/answer_brand_marketing_recognition/bin/python /Users/xuyingjie/venv/answer_brand_marketing_recognition/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/k2/n3kff0pd6k995znpn70jbn6w0000gq/T/tmpwslk_3c2 cwd: /private/var/folders/k2/n3kff0pd6k995znpn70jbn6w0000gq/T/pip-install-_reqdzyi/tokenizers Complete output (36 lines): running bdist_wheel running build running build_py creating build creating build/lib creating build/lib/tokenizers copying tokenizers/__init__.py -> build/lib/tokenizers creating build/lib/tokenizers/models copying tokenizers/models/__init__.py -> build/lib/tokenizers/models creating build/lib/tokenizers/decoders copying tokenizers/decoders/__init__.py -> build/lib/tokenizers/decoders creating build/lib/tokenizers/normalizers copying tokenizers/normalizers/__init__.py -> build/lib/tokenizers/normalizers creating build/lib/tokenizers/pre_tokenizers copying tokenizers/pre_tokenizers/__init__.py -> build/lib/tokenizers/pre_tokenizers creating build/lib/tokenizers/processors copying tokenizers/processors/__init__.py -> build/lib/tokenizers/processors creating build/lib/tokenizers/trainers copying tokenizers/trainers/__init__.py -> build/lib/tokenizers/trainers creating build/lib/tokenizers/implementations copying tokenizers/implementations/byte_level_bpe.py -> build/lib/tokenizers/implementations copying tokenizers/implementations/sentencepiece_bpe.py -> build/lib/tokenizers/implementations copying tokenizers/implementations/base_tokenizer.py -> build/lib/tokenizers/implementations copying tokenizers/implementations/__init__.py -> build/lib/tokenizers/implementations copying tokenizers/implementations/char_level_bpe.py -> build/lib/tokenizers/implementations copying tokenizers/implementations/bert_wordpiece.py -> build/lib/tokenizers/implementations copying tokenizers/__init__.pyi -> build/lib/tokenizers copying tokenizers/models/__init__.pyi -> build/lib/tokenizers/models copying tokenizers/decoders/__init__.pyi -> build/lib/tokenizers/decoders copying tokenizers/normalizers/__init__.pyi -> build/lib/tokenizers/normalizers copying tokenizers/pre_tokenizers/__init__.pyi -> build/lib/tokenizers/pre_tokenizers copying tokenizers/processors/__init__.pyi -> build/lib/tokenizers/processors copying tokenizers/trainers/__init__.pyi -> build/lib/tokenizers/trainers running build_ext running build_rust error: Can not find Rust compiler ---------------------------------------- ERROR: Failed building wheel for tokenizers Failed to build tokenizers ERROR: Could not build wheels for tokenizers which use PEP 517 and cannot be installed directly <!-- You should first ask your question on SO, and only if you didn't get an answer ask it here on GitHub. --> **A link to original question on Stack Overflow**:
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4307/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4307/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4306
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4306/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4306/comments
https://api.github.com/repos/huggingface/transformers/issues/4306/events
https://github.com/huggingface/transformers/issues/4306
616,426,900
MDU6SXNzdWU2MTY0MjY5MDA=
4,306
Multiple token prediction with MLM
{ "login": "jannisborn", "id": 15703818, "node_id": "MDQ6VXNlcjE1NzAzODE4", "avatar_url": "https://avatars.githubusercontent.com/u/15703818?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jannisborn", "html_url": "https://github.com/jannisborn", "followers_url": "https://api.github.com/users/jannisborn/followers", "following_url": "https://api.github.com/users/jannisborn/following{/other_user}", "gists_url": "https://api.github.com/users/jannisborn/gists{/gist_id}", "starred_url": "https://api.github.com/users/jannisborn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jannisborn/subscriptions", "organizations_url": "https://api.github.com/users/jannisborn/orgs", "repos_url": "https://api.github.com/users/jannisborn/repos", "events_url": "https://api.github.com/users/jannisborn/events{/privacy}", "received_events_url": "https://api.github.com/users/jannisborn/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "An error message would be great, want to submit a PR?\r\n\r\nFor multiple masked token support, I'm not entirely sure. The sampling might be very use case-specific.", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n", "I'm facing a situation where I've to fetch probabilities from BERT MLM for multiple words in a single sentence.\r\n\r\n Original : \"Mountain Dew is an energetic drink\"\r\n Masked : \"[MASK] is an energetic drink\"\r\n\r\nBut BERT MLM task doesn't consider two tokens at a time for the MASK. ", "@stephen-pilli \r\n\r\nHere's how to mask multiple tokens.\r\n\r\n```\r\nimport torch\r\n\r\nsentence = \"The capital of France <mask> contains the Eiffel <mask>.\"\r\n\r\ntoken_ids = tokenizer.encode(sentence, return_tensors='pt')\r\n\r\n# print(token_ids)\r\n\r\ntoken_ids_tk = tokenizer.tokenize(sentence, return_tensors='pt')\r\n\r\nprint(token_ids_tk)\r\n\r\nmasked_position = (token_ids.squeeze() == tokenizer.mask_token_id).nonzero()\r\n\r\nmasked_pos = [mask.item() for mask in masked_position ]\r\n\r\nprint (masked_pos)\r\n\r\nwith torch.no_grad():\r\n\r\n output = model(token_ids)\r\n\r\nlast_hidden_state = output[0].squeeze()\r\n\r\nprint (\"\\n\\n\")\r\n\r\nprint (\"sentence : \",sentence)\r\n\r\nprint (\"\\n\")\r\n\r\nlist_of_list =[]\r\n\r\nfor mask_index in masked_pos:\r\n\r\n mask_hidden_state = last_hidden_state[mask_index]\r\n\r\n idx = torch.topk(mask_hidden_state, k=100, dim=0)[1]\r\n\r\n words = [tokenizer.decode(i.item()).strip() for i in idx]\r\n\r\n list_of_list.append(words)\r\n\r\n print (words)\r\n\r\n\r\nbest_guess = \"\"\r\n\r\nfor j in list_of_list:\r\n\r\n best_guess = best_guess+\" \"+j[0]\r\n```" ]
1,589
1,620
1,595
CONTRIBUTOR
null
# 🚀 Feature request It would be great if the `fill_mask` interface would be able to predict multiple tokens at a time. ## Motivation I didn't find any related issue. Using transformer for chemical data, queries like `fill_mask('CCCO<mask>C')` work fine. But writing `fill_mask('CC<mask>CO<mask>C')` I obtain: ``` ~/miniconda3/envs/paccmann/lib/python3.7/site-packages/transformers/pipelines.py in __call__(self, *args, **kwargs) 553 values, predictions = topk.values.numpy(), topk.indices.numpy() 554 else: --> 555 masked_index = (input_ids == self.tokenizer.mask_token_id).nonzero().item() 556 logits = outputs[i, masked_index, :] 557 probs = logits.softmax(dim=0) ValueError: only one element tensors can be converted to Python scalars ``` ## Your contribution The user can easily implement an auto-regressive solution and given that `fill_mask` returns the `topk` tokens, one could even select between greedy search, beam search or a probabilistic sampling. But a one-shot approach would be preferable since it minimizes probabilities to aggregate errors as in auto-regression. Rather than outsourcing this to the user, I'd prefer a solution integrated into the package. As minimum request, I would like to propose to raise a proper error message instead of the obtained `ValueError`.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4306/reactions", "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4306/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4305
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4305/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4305/comments
https://api.github.com/repos/huggingface/transformers/issues/4305/events
https://github.com/huggingface/transformers/pull/4305
616,423,200
MDExOlB1bGxSZXF1ZXN0NDE2NTM2NTAx
4,305
fixed missing torch module import
{ "login": "lserinol", "id": 13028689, "node_id": "MDQ6VXNlcjEzMDI4Njg5", "avatar_url": "https://avatars.githubusercontent.com/u/13028689?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lserinol", "html_url": "https://github.com/lserinol", "followers_url": "https://api.github.com/users/lserinol/followers", "following_url": "https://api.github.com/users/lserinol/following{/other_user}", "gists_url": "https://api.github.com/users/lserinol/gists{/gist_id}", "starred_url": "https://api.github.com/users/lserinol/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lserinol/subscriptions", "organizations_url": "https://api.github.com/users/lserinol/orgs", "repos_url": "https://api.github.com/users/lserinol/repos", "events_url": "https://api.github.com/users/lserinol/events{/privacy}", "received_events_url": "https://api.github.com/users/lserinol/received_events", "type": "User", "site_admin": false }
[ { "id": 1838412367, "node_id": "MDU6TGFiZWwxODM4NDEyMzY3", "url": "https://api.github.com/repos/huggingface/transformers/labels/model%20card", "name": "model card", "color": "92d5f4", "default": false, "description": "Related to pretrained model cards" } ]
closed
false
null
[]
[]
1,589
1,589
1,589
CONTRIBUTOR
null
fixed missing torch module import in example usage code
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4305/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4305/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4305", "html_url": "https://github.com/huggingface/transformers/pull/4305", "diff_url": "https://github.com/huggingface/transformers/pull/4305.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4305.patch", "merged_at": 1589286858000 }
https://api.github.com/repos/huggingface/transformers/issues/4304
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4304/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4304/comments
https://api.github.com/repos/huggingface/transformers/issues/4304/events
https://github.com/huggingface/transformers/issues/4304
616,403,075
MDU6SXNzdWU2MTY0MDMwNzU=
4,304
Latest Version Of HuggingFace is Not Using GPUs
{ "login": "AdityaSoni19031997", "id": 22738086, "node_id": "MDQ6VXNlcjIyNzM4MDg2", "avatar_url": "https://avatars.githubusercontent.com/u/22738086?v=4", "gravatar_id": "", "url": "https://api.github.com/users/AdityaSoni19031997", "html_url": "https://github.com/AdityaSoni19031997", "followers_url": "https://api.github.com/users/AdityaSoni19031997/followers", "following_url": "https://api.github.com/users/AdityaSoni19031997/following{/other_user}", "gists_url": "https://api.github.com/users/AdityaSoni19031997/gists{/gist_id}", "starred_url": "https://api.github.com/users/AdityaSoni19031997/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/AdityaSoni19031997/subscriptions", "organizations_url": "https://api.github.com/users/AdityaSoni19031997/orgs", "repos_url": "https://api.github.com/users/AdityaSoni19031997/repos", "events_url": "https://api.github.com/users/AdityaSoni19031997/events{/privacy}", "received_events_url": "https://api.github.com/users/AdityaSoni19031997/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "If you don't tell us what code you use, we cannot help you. Be detailed and use code block. Don't post screenshots. ", "I agree. I apologize, was kinda annoyed that version diff can cause this. Will share a minimal example. (In the mean time, re-verifying via setting up different env's)", "Did you manage to solve the error?", "Hey I am sorry for the delay, I am having fever since yesterday, I am trying to replicate it. ", "Okay, so i am not able to replicate the same on a dummy test i had run just now; seems all good ; Will ping back if the same thing happens for my code; My apologies to great devs ;", "@AdityaSoni19031997 I am also facing the same issue. New transformers version is not using GPU and it's quite slow.", "I have solved the issue.\r\nYou have to manually set the device and load the tensors to GPU:\r\n\r\n```\r\nfrom transformers import BertTokenizer, BertModel, BertForMaskedLM\r\n\r\n\r\ndef assign_GPU(Tokenizer_output):\r\n \r\n tokens_tensor = Tokenizer_output['input_ids'].to('cuda:0')\r\n token_type_ids = Tokenizer_output['token_type_ids'].to('cuda:0')\r\n attention_mask = Tokenizer_output['attention_mask'].to('cuda:0')\r\n \r\n output = {'input_ids' : tokens_tensor, \r\n 'token_type_ids' : token_type_ids, \r\n 'attention_mask' : attention_mask}\r\n \r\n return output\r\n\r\n\r\n\r\nsentence = 'Hello World!'\r\ntokenizer = BertTokenizer.from_pretrained('bert-large-uncased')\r\nmodel = BertModel.from_pretrained('bert-large-uncased')\r\n\r\ninputs = assign_GPU(tokenizer(sentence, return_tensors=\"pt\"))\r\nmodel = model.to('cuda:0')\r\noutputs = model(**inputs)\r\noutputs\r\n```", "In my case, it was a conflict of driver's IIRC." ]
1,589
1,594
1,589
CONTRIBUTOR
null
I switched from v2.8 to v2.9 today morning keeping all my experiments, enviornment same etc but the same code which used v2.8 has an epoch time of 5 mins, where as in v2.9 it's more than 2 hours. Code was custom which was working till yesterday with v2.8. Please verify the same.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4304/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4304/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4303
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4303/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4303/comments
https://api.github.com/repos/huggingface/transformers/issues/4303/events
https://github.com/huggingface/transformers/issues/4303
616,394,243
MDU6SXNzdWU2MTYzOTQyNDM=
4,303
How to perform Agglomerative clustering on Albert model last hidden state output, it gives tuple of tensors for each sequence in a sentence. I am processing multiple sentences from a document, How to achieve this ?
{ "login": "daraksha-shirin", "id": 53253192, "node_id": "MDQ6VXNlcjUzMjUzMTky", "avatar_url": "https://avatars.githubusercontent.com/u/53253192?v=4", "gravatar_id": "", "url": "https://api.github.com/users/daraksha-shirin", "html_url": "https://github.com/daraksha-shirin", "followers_url": "https://api.github.com/users/daraksha-shirin/followers", "following_url": "https://api.github.com/users/daraksha-shirin/following{/other_user}", "gists_url": "https://api.github.com/users/daraksha-shirin/gists{/gist_id}", "starred_url": "https://api.github.com/users/daraksha-shirin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/daraksha-shirin/subscriptions", "organizations_url": "https://api.github.com/users/daraksha-shirin/orgs", "repos_url": "https://api.github.com/users/daraksha-shirin/repos", "events_url": "https://api.github.com/users/daraksha-shirin/events{/privacy}", "received_events_url": "https://api.github.com/users/daraksha-shirin/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,595
1,595
NONE
null
# ❓ Questions & Help <!-- The GitHub issue tracker is primarly intended for bugs, feature requests, new models and benchmarks, and migration questions. For all other questions, we direct you to Stack Overflow (SO) where a whole community of PyTorch and Tensorflow enthusiast can help you out. Make sure to tag your question with the right deep learning framework as well as the huggingface-transformers tag: https://stackoverflow.com/questions/tagged/huggingface-transformers If your question wasn't answered after a period of time on Stack Overflow, you can always open a question on GitHub. You should then link to the SO question that you posted. --> ## Details <!-- Description of your issue --> <!-- You should first ask your question on SO, and only if you didn't get an answer ask it here on GitHub. --> **A link to original question on Stack Overflow**:
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4303/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4303/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4302
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4302/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4302/comments
https://api.github.com/repos/huggingface/transformers/issues/4302/events
https://github.com/huggingface/transformers/pull/4302
616,382,224
MDExOlB1bGxSZXF1ZXN0NDE2NTAzOTMz
4,302
Remove args from args.tf_dump_path
{ "login": "kalyangvs", "id": 42022935, "node_id": "MDQ6VXNlcjQyMDIyOTM1", "avatar_url": "https://avatars.githubusercontent.com/u/42022935?v=4", "gravatar_id": "", "url": "https://api.github.com/users/kalyangvs", "html_url": "https://github.com/kalyangvs", "followers_url": "https://api.github.com/users/kalyangvs/followers", "following_url": "https://api.github.com/users/kalyangvs/following{/other_user}", "gists_url": "https://api.github.com/users/kalyangvs/gists{/gist_id}", "starred_url": "https://api.github.com/users/kalyangvs/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kalyangvs/subscriptions", "organizations_url": "https://api.github.com/users/kalyangvs/orgs", "repos_url": "https://api.github.com/users/kalyangvs/repos", "events_url": "https://api.github.com/users/kalyangvs/events{/privacy}", "received_events_url": "https://api.github.com/users/kalyangvs/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,594
1,594
NONE
null
Edit args.tf_dump_path in convert_all_pt_checkpoints_to_tf
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4302/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4302/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4302", "html_url": "https://github.com/huggingface/transformers/pull/4302", "diff_url": "https://github.com/huggingface/transformers/pull/4302.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4302.patch", "merged_at": null }
https://api.github.com/repos/huggingface/transformers/issues/4301
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4301/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4301/comments
https://api.github.com/repos/huggingface/transformers/issues/4301/events
https://github.com/huggingface/transformers/issues/4301
616,306,298
MDU6SXNzdWU2MTYzMDYyOTg=
4,301
why squad.py did not reproduce squad1.1 report result?
{ "login": "yyHaker", "id": 18585628, "node_id": "MDQ6VXNlcjE4NTg1NjI4", "avatar_url": "https://avatars.githubusercontent.com/u/18585628?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yyHaker", "html_url": "https://github.com/yyHaker", "followers_url": "https://api.github.com/users/yyHaker/followers", "following_url": "https://api.github.com/users/yyHaker/following{/other_user}", "gists_url": "https://api.github.com/users/yyHaker/gists{/gist_id}", "starred_url": "https://api.github.com/users/yyHaker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yyHaker/subscriptions", "organizations_url": "https://api.github.com/users/yyHaker/orgs", "repos_url": "https://api.github.com/users/yyHaker/repos", "events_url": "https://api.github.com/users/yyHaker/events{/privacy}", "received_events_url": "https://api.github.com/users/yyHaker/received_events", "type": "User", "site_admin": false }
[ { "id": 1897896961, "node_id": "MDU6TGFiZWwxODk3ODk2OTYx", "url": "https://api.github.com/repos/huggingface/transformers/labels/Migration", "name": "Migration", "color": "e99695", "default": false, "description": "" } ]
closed
false
null
[]
[ "I have just solved this problem.\r\nYou have to set an additional flag: --do_lower_case.\r\nI wonder why the run_squad.py behaves differently than run_glue.py, etc. Is there is a code improve on the way?", "You shouldn't have to set `--do_lower_case` as it should be lowercased by default for that model.", "> You shouldn't have to set `--do_lower_case` as it should be lowercased by default for that model.\r\n\r\nI thought it is and it should be, but it isn't", "Closing this b/c #4245 was merged\r\n\r\n(we still need to investigate why the lowercasing is not properly populated by the model's config)\r\n" ]
1,589
1,590
1,590
NONE
null
# 📚 Migration ## Information <!-- Important information --> Model I am using (Bert, XLNet ...): Language I am using the model on (English...): The problem arises when using: * [x] the official example scripts: (give details below) examples/question-answering/run_squad.py * [x] my own modified scripts: (give details below) ''' CUDA_VISIBLE_DEVICES=5 python examples/question-answering//run_squad.py \ --model_type bert \ --model_name_or_path bert-large-uncased-whole-word-masking \ --do_train \ --do_eval \ --data_dir EKMRC/data/squad1.1 \ --train_file train-v1.1.json \ --predict_file dev-v1.1.json \ --per_gpu_eval_batch_size=4 \ --per_gpu_train_batch_size=4 \ --gradient_accumulation_steps=6 \ --save_steps 3682 \ --learning_rate 3e-5 \ --num_train_epochs 2 \ --max_seq_length 384 \ --doc_stride 128 \ --output_dir result/debug_squad/wwm_uncased_bert_large_finetuned_squad/ \ --overwrite_output_dir ''' The tasks I am working on is: * [x] an official GLUE/SQUaD task: (give the name) ## Details But I did not reproduce the result reported, the repository say get result bellow: ``` python $SQUAD_DIR/evaluate-v1.1.py $SQUAD_DIR/dev-v1.1.json ../models/wwm_uncased_finetuned_squad/predictions.json {"exact_match": 86.91579943235573, "f1": 93.1532499015869} ``` my result is below: ``` python $SQUAD_DIR/evaluate-v1.1.py $SQUAD_DIR/dev-v1.1.json ../models/wwm_uncased_finetuned_squad/predictions.json {"exact_match": 81.03, "f1": 88.02} ``` ## Environment info <!-- You can run the command `python transformers-cli env` and copy-and-paste its output below. Don't forget to fill out the missing fields in that output! --> - `transformers` version: - Platform: Linux gpu19 3.10.0-1062.4.1.el7.x86_64 #1 SMP Fri Oct 18 17:15:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux - Python version: python3.6 - PyTorch version (GPU?): 1.4.0 - Using GPU in script?: yes - Using distributed or parallel set-up in script?: parallel <!-- IMPORTANT: which version of the former library do you use? --> * `pytorch-transformers` or `pytorch-pretrained-bert` version (or branch): current version of transformers. ## Checklist - [yes ] I have read the migration guide in the readme. ([pytorch-transformers](https://github.com/huggingface/transformers#migrating-from-pytorch-transformers-to-transformers);
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4301/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4301/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4300
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4300/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4300/comments
https://api.github.com/repos/huggingface/transformers/issues/4300/events
https://github.com/huggingface/transformers/pull/4300
616,290,388
MDExOlB1bGxSZXF1ZXN0NDE2NDMxNjQy
4,300
Fix nn.DataParallel compatibility in PyTorch 1.5
{ "login": "julien-c", "id": 326577, "node_id": "MDQ6VXNlcjMyNjU3Nw==", "avatar_url": "https://avatars.githubusercontent.com/u/326577?v=4", "gravatar_id": "", "url": "https://api.github.com/users/julien-c", "html_url": "https://github.com/julien-c", "followers_url": "https://api.github.com/users/julien-c/followers", "following_url": "https://api.github.com/users/julien-c/following{/other_user}", "gists_url": "https://api.github.com/users/julien-c/gists{/gist_id}", "starred_url": "https://api.github.com/users/julien-c/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/julien-c/subscriptions", "organizations_url": "https://api.github.com/users/julien-c/orgs", "repos_url": "https://api.github.com/users/julien-c/repos", "events_url": "https://api.github.com/users/julien-c/events{/privacy}", "received_events_url": "https://api.github.com/users/julien-c/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4300?src=pr&el=h1) Report\n> Merging [#4300](https://codecov.io/gh/huggingface/transformers/pull/4300?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/7cb203fae4e7964e9e99400b375d660ebce765ee&el=desc) will **decrease** coverage by `0.00%`.\n> The diff coverage is `91.66%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4300/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4300?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4300 +/- ##\n==========================================\n- Coverage 78.21% 78.21% -0.01% \n==========================================\n Files 120 120 \n Lines 20038 20040 +2 \n==========================================\n+ Hits 15673 15674 +1 \n- Misses 4365 4366 +1 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4300?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [src/transformers/modeling\\_xlnet.py](https://codecov.io/gh/huggingface/transformers/pull/4300/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ194bG5ldC5weQ==) | `75.73% <75.00%> (ø)` | |\n| [src/transformers/modeling\\_albert.py](https://codecov.io/gh/huggingface/transformers/pull/4300/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19hbGJlcnQucHk=) | `77.20% <100.00%> (ø)` | |\n| [src/transformers/modeling\\_bert.py](https://codecov.io/gh/huggingface/transformers/pull/4300/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19iZXJ0LnB5) | `88.82% <100.00%> (ø)` | |\n| [src/transformers/modeling\\_t5.py](https://codecov.io/gh/huggingface/transformers/pull/4300/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190NS5weQ==) | `83.66% <100.00%> (ø)` | |\n| [src/transformers/modeling\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4300/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `90.98% <100.00%> (+0.02%)` | :arrow_up: |\n| [src/transformers/file\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4300/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `73.44% <0.00%> (-0.42%)` | :arrow_down: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4300?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4300?src=pr&el=footer). Last update [7cb203f...7eef4f5](https://codecov.io/gh/huggingface/transformers/pull/4300?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "Update: Also asked about this on shared [PyTorch Slack channel](https://app.slack.com/client/T2077MDKQ/CN963QVJB)", "I don't see anything obviously wrong, but I'm not very familiar with your codebase. You are looking for tensor attributes - are you sure that you don't have any other tensor attributes that don't correspond to former parameters? \r\nFinally, we also have _former_parameters in pytorch, introduced here https://github.com/pytorch/pytorch/pull/36523. You may find it useful, but we can't guarantee that it will remain as a stable API. ", "I think you forgot GPT-2:\r\n`transformers/modeling_gpt2.py\", line 464, in forward\r\n attention_mask = attention_mask.to(dtype=next(self.parameters()).dtype) # fp16 compatibility\r\nStopIteration\r\n`", "Yes, if I remember correctly I didn't try to remove all the calls to `next(self.parameters())` in this PR – do you want to open a PR to fix this?" ]
1,589
1,600
1,589
MEMBER
null
As reported in #3936 PyTorch 1.5 changes the handling of nn.Parameters in `DataParallel` replicas. (https://github.com/pytorch/pytorch/pull/33907). The replicas now don't have parameters() anymore. This PR updates our `self.device` and `self.dtype` helpers to mimic `nn.Module`'s `parameters()` helper but for attributes, i.e. recursively look for an attribute of type Tensor. Reformer and TransfoXL seem to be doing fancy things based on the module's Parameters so I didn't attempt to fix them. Finally I'm introducing a `multigpu` CI flag. CI does not currently run on multiple GPUs so remember to run it locally. --- Also pinging @ngimel the author of the change in PyTorch, to check if I'm doing something stupid here.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4300/reactions", "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 1, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4300/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4300", "html_url": "https://github.com/huggingface/transformers/pull/4300", "diff_url": "https://github.com/huggingface/transformers/pull/4300.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4300.patch", "merged_at": 1589848490000 }
https://api.github.com/repos/huggingface/transformers/issues/4299
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4299/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4299/comments
https://api.github.com/repos/huggingface/transformers/issues/4299/events
https://github.com/huggingface/transformers/issues/4299
616,257,011
MDU6SXNzdWU2MTYyNTcwMTE=
4,299
Issue with XLNet using xlnet-base-cased
{ "login": "enriqueb721", "id": 11673418, "node_id": "MDQ6VXNlcjExNjczNDE4", "avatar_url": "https://avatars.githubusercontent.com/u/11673418?v=4", "gravatar_id": "", "url": "https://api.github.com/users/enriqueb721", "html_url": "https://github.com/enriqueb721", "followers_url": "https://api.github.com/users/enriqueb721/followers", "following_url": "https://api.github.com/users/enriqueb721/following{/other_user}", "gists_url": "https://api.github.com/users/enriqueb721/gists{/gist_id}", "starred_url": "https://api.github.com/users/enriqueb721/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/enriqueb721/subscriptions", "organizations_url": "https://api.github.com/users/enriqueb721/orgs", "repos_url": "https://api.github.com/users/enriqueb721/repos", "events_url": "https://api.github.com/users/enriqueb721/events{/privacy}", "received_events_url": "https://api.github.com/users/enriqueb721/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
{ "login": "LysandreJik", "id": 30755778, "node_id": "MDQ6VXNlcjMwNzU1Nzc4", "avatar_url": "https://avatars.githubusercontent.com/u/30755778?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LysandreJik", "html_url": "https://github.com/LysandreJik", "followers_url": "https://api.github.com/users/LysandreJik/followers", "following_url": "https://api.github.com/users/LysandreJik/following{/other_user}", "gists_url": "https://api.github.com/users/LysandreJik/gists{/gist_id}", "starred_url": "https://api.github.com/users/LysandreJik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LysandreJik/subscriptions", "organizations_url": "https://api.github.com/users/LysandreJik/orgs", "repos_url": "https://api.github.com/users/LysandreJik/repos", "events_url": "https://api.github.com/users/LysandreJik/events{/privacy}", "received_events_url": "https://api.github.com/users/LysandreJik/received_events", "type": "User", "site_admin": false }
[ { "login": "LysandreJik", "id": 30755778, "node_id": "MDQ6VXNlcjMwNzU1Nzc4", "avatar_url": "https://avatars.githubusercontent.com/u/30755778?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LysandreJik", "html_url": "https://github.com/LysandreJik", "followers_url": "https://api.github.com/users/LysandreJik/followers", "following_url": "https://api.github.com/users/LysandreJik/following{/other_user}", "gists_url": "https://api.github.com/users/LysandreJik/gists{/gist_id}", "starred_url": "https://api.github.com/users/LysandreJik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LysandreJik/subscriptions", "organizations_url": "https://api.github.com/users/LysandreJik/orgs", "repos_url": "https://api.github.com/users/LysandreJik/repos", "events_url": "https://api.github.com/users/LysandreJik/events{/privacy}", "received_events_url": "https://api.github.com/users/LysandreJik/received_events", "type": "User", "site_admin": false } ]
[ "I also have the same problem @alexandrenriq ", "I think there's a mistake in the code which sets the `AutoModelForQuestionAnswering` as `XLNetForQuestionAnsweringSimple`. You can run the code by substituting `AutoModelForQuestionAnswering` into `XLNetForQuestionAnswering` (or by removing `cls_index` and `p_mask` in the batches to make `XLNetForQuestionAnsweringSimple` work). \r\n\r\nNevertheless, after the training is done, I can't reproduce the scores right (`Results: {'exact': 0.03784295175023652, 'f1': 0.6317807409886281,...`).", "I also found the same issue, and I believe this issue appears for a very very long time. ", "see also #3535", "> see also #3535\n\n@brettkoonce I saw it, it didn't work. ", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,602
1,602
NONE
null
# 🐛 Bug ## Information Model I am using (Bert, XLNet ...): XLNet Language I am using the model on (English, Chinese ...): English The problem arises when using: * [x] the official example scripts: (give details below) * [ ] my own modified scripts: (give details below) The tasks I am working on is: * [x] an official GLUE/SQUaD task: SQUaD v1.1 * [ ] my own task or dataset: (give details below) ## To reproduce Steps to reproduce the behavior: 1. Clone the repository ``` !git clone https://github.com/huggingface/transformers.git ``` 2. ``` !python ./transformers/examples/question-answering/run_squad.py \ --model_type xlnet \ --model_name_or_path xlnet-base-cased \ --do_train \ --do_eval \ --train_file $SQuAD_Dir/train-v1.1.json \ --predict_file $SQuAD_Dir/dev-v1.1.json \ --learning_rate 3e-5 \ --num_train_epochs 2 \ --max_seq_length 384 \ --doc_stride 128 \ --output_dir ./model_output \ --per_gpu_eval_batch_size=4 \ --per_gpu_train_batch_size=4 \ --save_steps 5000 ``` 3. Error ``` Epoch: 0% 0/2 [00:00<?, ?it/s] Iteration: 0% 0/15852 [00:00<?, ?it/s]Traceback (most recent call last): File "./transformers/examples/question-answering/run_squad.py", line 830, in <module> main() File "./transformers/examples/question-answering/run_squad.py", line 769, in main global_step, tr_loss = train(args, train_dataset, model, tokenizer) File "./transformers/examples/question-answering/run_squad.py", line 204, in train outputs = model(**inputs) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 550, in __call__ result = self.forward(*input, **kwargs) TypeError: forward() got an unexpected keyword argument 'cls_index' ``` <!-- If you have code snippets, error messages, stack traces please provide them here as well. Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.--> ## Expected behavior The model should start training from the first epoch. <!-- A clear and concise description of what you would expect to happen. --> ## Environment info <!-- You can run the command `transformers-cli env` and copy-and-paste its output below. Don't forget to fill out the missing fields in that output! --> - `transformers` version: 2.9.0 - Platform: Google Colab Pro - Python version: 3.6.9 - PyTorch version (GPU?): 1.5.0+cu101 (Yes) - Tensorflow version (GPU?): 2.2.0 (Yes) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4299/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4299/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4298
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4298/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4298/comments
https://api.github.com/repos/huggingface/transformers/issues/4298/events
https://github.com/huggingface/transformers/pull/4298
616,255,513
MDExOlB1bGxSZXF1ZXN0NDE2NDAzNDk1
4,298
Fix BART tests on GPU
{ "login": "julien-c", "id": 326577, "node_id": "MDQ6VXNlcjMyNjU3Nw==", "avatar_url": "https://avatars.githubusercontent.com/u/326577?v=4", "gravatar_id": "", "url": "https://api.github.com/users/julien-c", "html_url": "https://github.com/julien-c", "followers_url": "https://api.github.com/users/julien-c/followers", "following_url": "https://api.github.com/users/julien-c/following{/other_user}", "gists_url": "https://api.github.com/users/julien-c/gists{/gist_id}", "starred_url": "https://api.github.com/users/julien-c/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/julien-c/subscriptions", "organizations_url": "https://api.github.com/users/julien-c/orgs", "repos_url": "https://api.github.com/users/julien-c/repos", "events_url": "https://api.github.com/users/julien-c/events{/privacy}", "received_events_url": "https://api.github.com/users/julien-c/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,589
1,589
1,589
MEMBER
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4298/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4298/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4298", "html_url": "https://github.com/huggingface/transformers/pull/4298", "diff_url": "https://github.com/huggingface/transformers/pull/4298.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4298.patch", "merged_at": 1589289111000 }
https://api.github.com/repos/huggingface/transformers/issues/4297
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4297/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4297/comments
https://api.github.com/repos/huggingface/transformers/issues/4297/events
https://github.com/huggingface/transformers/pull/4297
616,240,186
MDExOlB1bGxSZXF1ZXN0NDE2MzkwODE1
4,297
pin TF to 2.1
{ "login": "LysandreJik", "id": 30755778, "node_id": "MDQ6VXNlcjMwNzU1Nzc4", "avatar_url": "https://avatars.githubusercontent.com/u/30755778?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LysandreJik", "html_url": "https://github.com/LysandreJik", "followers_url": "https://api.github.com/users/LysandreJik/followers", "following_url": "https://api.github.com/users/LysandreJik/following{/other_user}", "gists_url": "https://api.github.com/users/LysandreJik/gists{/gist_id}", "starred_url": "https://api.github.com/users/LysandreJik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LysandreJik/subscriptions", "organizations_url": "https://api.github.com/users/LysandreJik/orgs", "repos_url": "https://api.github.com/users/LysandreJik/repos", "events_url": "https://api.github.com/users/LysandreJik/events{/privacy}", "received_events_url": "https://api.github.com/users/LysandreJik/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,589
1,589
1,589
MEMBER
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4297/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4297/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4297", "html_url": "https://github.com/huggingface/transformers/pull/4297", "diff_url": "https://github.com/huggingface/transformers/pull/4297.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4297.patch", "merged_at": 1589245411000 }
https://api.github.com/repos/huggingface/transformers/issues/4296
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4296/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4296/comments
https://api.github.com/repos/huggingface/transformers/issues/4296/events
https://github.com/huggingface/transformers/issues/4296
616,237,745
MDU6SXNzdWU2MTYyMzc3NDU=
4,296
Error Training T5 Transformer Translation Model
{ "login": "jameschartouni", "id": 16104649, "node_id": "MDQ6VXNlcjE2MTA0NjQ5", "avatar_url": "https://avatars.githubusercontent.com/u/16104649?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jameschartouni", "html_url": "https://github.com/jameschartouni", "followers_url": "https://api.github.com/users/jameschartouni/followers", "following_url": "https://api.github.com/users/jameschartouni/following{/other_user}", "gists_url": "https://api.github.com/users/jameschartouni/gists{/gist_id}", "starred_url": "https://api.github.com/users/jameschartouni/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jameschartouni/subscriptions", "organizations_url": "https://api.github.com/users/jameschartouni/orgs", "repos_url": "https://api.github.com/users/jameschartouni/repos", "events_url": "https://api.github.com/users/jameschartouni/events{/privacy}", "received_events_url": "https://api.github.com/users/jameschartouni/received_events", "type": "User", "site_admin": false }
[]
closed
false
{ "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false }
[ { "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false } ]
[ "Which library are you using? Could you maybe post a complete code example (with all relevant imports) to reproduce the error? ", "https://github.com/jameschartouni/arabic_translation/blob/google-t5/Model_1.ipynb\r\n\r\nLet me know if you have difficulty viewing the code! We are using colab and use a fresh install. ", "I see you use the official T5 code that connects to HF code. The error seems to be happening in the `t5` library though (in `t5/models/hf_model.py`). Could you open an issue there? We haven't written the code so it's very hard for us to debug this." ]
1,589
1,591
1,591
NONE
null
# ❓ Questions & Help <!-- The GitHub issue tracker is primarly intended for bugs, feature requests, new models and benchmarks, and migration questions. For all other questions, we direct you to Stack Overflow (SO) where a whole community of PyTorch and Tensorflow enthusiast can help you out. Make sure to tag your question with the right deep learning framework as well as the huggingface-transformers tag: https://stackoverflow.com/questions/tagged/huggingface-transformers If your question wasn't answered after a period of time on Stack Overflow, you can always open a question on GitHub. You should then link to the SO question that you posted. --> ## Details We are trying to train a T5 model to translate between English, Modern Standard Arabic, Levantine Arabic and Maghrebi Arabic. We are using Tensorflow to process the code as well as the default Sentence Piece tokenizer and custom Sentence Piece Tokenizer both set to the default Vocab size of 32,128. Below is the hyper parameters we used for training the model and one of the languages T5 Data Task Registry. ``` t5.data.TaskRegistry.remove("mag_msa_translation") t5.data.TaskRegistry.add( #name of the Task "mag_msa_translation", #Supply a function which returns a tf.data.Dataset dataset_fn=mag_msa_translation_dataset_fn, splits=["train", "validation"], # Supply a function which preprocesses text from the tf.data.Dataset. text_preprocessor=[mag_msa_translation_preprocessor], # Use the same vocabulary that we used for pre-training. sentencepiece_model_path=filepath, #str(multibpemb.model_file), #t5.data.DEFAULT_SPM_PATH # Lowercase targets before computing metrics. postprocess_fn = t5.data.postprocessors.lower_text, # We'll use accuracy as our evaluation metric. metric_fns=[t5.evaluation.metrics.accuracy], # Not required, but helps for mixing and auto-caching. #num_input_examples=num_nq_examples ) ``` ``` STEPS = 1000 #@param {type: "integer"} model.train( mixture_or_task_name="ar_translation", steps=STEPS, save_steps=100, sequence_length={"inputs": 128, "targets": 128'},#128 split="train", batch_size=32, #32 optimizer=functools.partial(transformers.AdamW, lr=1e-4), ) ``` Why are we receiving the error posted below? ![image](https://user-images.githubusercontent.com/16104649/81619673-1c858780-93b8-11ea-8706-54e1db3895f5.png) Please let me know if you need to see more code or have any additional clarifying questions. Thank you in advance! <!-- You should first ask your question on SO, and only if you didn't get an answer ask it here on GitHub. --> **A link to original question on Stack Overflow**:
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4296/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4296/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4295
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4295/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4295/comments
https://api.github.com/repos/huggingface/transformers/issues/4295/events
https://github.com/huggingface/transformers/pull/4295
616,180,071
MDExOlB1bGxSZXF1ZXN0NDE2MzQyMjA0
4,295
[Docs, Notebook] Include generation pipeline
{ "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,589
1,589
1,589
MEMBER
null
- adds the generation pipeline to usage docs with a couple of examples - adds the generation pipeline to the notebook - Also, I updated the config of all models that can be used with generation with model specific params: GPT2, OpenAI-GPT, XLNet, TransfoXL, Reformer, so that they now include a `text-generation` special params dict.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4295/reactions", "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4295/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4295", "html_url": "https://github.com/huggingface/transformers/pull/4295", "diff_url": "https://github.com/huggingface/transformers/pull/4295.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4295.patch", "merged_at": 1589394248000 }
https://api.github.com/repos/huggingface/transformers/issues/4294
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4294/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4294/comments
https://api.github.com/repos/huggingface/transformers/issues/4294/events
https://github.com/huggingface/transformers/pull/4294
616,168,487
MDExOlB1bGxSZXF1ZXN0NDE2MzMyNzE4
4,294
Documentation specification
{ "login": "LysandreJik", "id": 30755778, "node_id": "MDQ6VXNlcjMwNzU1Nzc4", "avatar_url": "https://avatars.githubusercontent.com/u/30755778?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LysandreJik", "html_url": "https://github.com/LysandreJik", "followers_url": "https://api.github.com/users/LysandreJik/followers", "following_url": "https://api.github.com/users/LysandreJik/following{/other_user}", "gists_url": "https://api.github.com/users/LysandreJik/gists{/gist_id}", "starred_url": "https://api.github.com/users/LysandreJik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LysandreJik/subscriptions", "organizations_url": "https://api.github.com/users/LysandreJik/orgs", "repos_url": "https://api.github.com/users/LysandreJik/repos", "events_url": "https://api.github.com/users/LysandreJik/events{/privacy}", "received_events_url": "https://api.github.com/users/LysandreJik/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,589
1,589
1,589
MEMBER
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4294/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4294/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4294", "html_url": "https://github.com/huggingface/transformers/pull/4294", "diff_url": "https://github.com/huggingface/transformers/pull/4294.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4294.patch", "merged_at": 1589229837000 }
https://api.github.com/repos/huggingface/transformers/issues/4293
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4293/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4293/comments
https://api.github.com/repos/huggingface/transformers/issues/4293/events
https://github.com/huggingface/transformers/issues/4293
616,151,099
MDU6SXNzdWU2MTYxNTEwOTk=
4,293
No crossattention layers in decoder from pretrained encoder-decoder model
{ "login": "hammad001", "id": 8685649, "node_id": "MDQ6VXNlcjg2ODU2NDk=", "avatar_url": "https://avatars.githubusercontent.com/u/8685649?v=4", "gravatar_id": "", "url": "https://api.github.com/users/hammad001", "html_url": "https://github.com/hammad001", "followers_url": "https://api.github.com/users/hammad001/followers", "following_url": "https://api.github.com/users/hammad001/following{/other_user}", "gists_url": "https://api.github.com/users/hammad001/gists{/gist_id}", "starred_url": "https://api.github.com/users/hammad001/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hammad001/subscriptions", "organizations_url": "https://api.github.com/users/hammad001/orgs", "repos_url": "https://api.github.com/users/hammad001/repos", "events_url": "https://api.github.com/users/hammad001/events{/privacy}", "received_events_url": "https://api.github.com/users/hammad001/received_events", "type": "User", "site_admin": false }
[]
closed
false
{ "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false }
[ { "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false } ]
[ "A simple fix could be:\r\n\r\n1. Adding in file [modeling_encoder_decoder.py](https://github.com/huggingface/transformers/blob/master/src/transformers/modeling_encoder_decoder.py) @ line 140:\r\n\r\n```\r\nkwargs_decoder[\"is_decoder\"]=True\r\n```\r\n\r\n2. Adding in file [modeling_auto.py](https://github.com/huggingface/transformers/blob/61d22f9cc7fbb0556d1e14447957a7ac6441421b/src/transformers/modeling_auto.py#L570) @ line 570\r\n\r\n```\r\nif not isinstance(config, PretrainedConfig):\r\n config = AutoConfig.from_pretrained(pretrained_model_name_or_path, **kwargs)\r\n if kwargs.pop(\"is_decoder\", None):\r\n config.is_decoder=True\r\n```\r\n\r\nThat's is it! It should be good to go. The crossattention layers will be initialized; although it's weights will not be initialized. That will have to be trained.\r\n \r\n\r\n", "Hi @hammad001 - thanks a lot for finding this bug. It has helped me a lot. This PR: https://github.com/huggingface/transformers/pull/4680 should fix it :-) " ]
1,589
1,590
1,590
NONE
null
# 🐛 Bug ## Information Model I am using (Bert, XLNet ...): BERT Language I am using the model on (English, Chinese ...): English The problem arises when using: * [ ] the official example scripts: (give details below) * [x] my own modified scripts: (give details below) The tasks I am working on is: * [ ] an official GLUE/SQUaD task: (give the name) * [x] my own task or dataset: (give details below) Custom sequence to sequence task. ## To reproduce Steps to reproduce the behavior: 1. Run the following script: ``` from transformers import EncoderDecoderModel model = EncoderDecoderModel.from_encoder_decoder_pretrained('bert-base-uncased', 'bert-base-uncased') print(model.get_decoder()) ``` 2. You will find there's no crossattention layers in the decoder. ## Expected behavior Cross attention layers initialized (not weights, but the layers themselves) in the decoder. ## Environment info - `transformers` version: 2.9.0 - Platform: Linux-5.5.6-1.el7.x86_64-x86_64-with-debian-buster-sid - Python version: 3.7.4 - PyTorch version (GPU?): 1.3.0 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: NO - Using distributed or parallel set-up in script?:NO
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4293/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4293/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4292
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4292/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4292/comments
https://api.github.com/repos/huggingface/transformers/issues/4292/events
https://github.com/huggingface/transformers/pull/4292
616,112,050
MDExOlB1bGxSZXF1ZXN0NDE2Mjg3MTI0
4,292
Fix special token doc
{ "login": "LysandreJik", "id": 30755778, "node_id": "MDQ6VXNlcjMwNzU1Nzc4", "avatar_url": "https://avatars.githubusercontent.com/u/30755778?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LysandreJik", "html_url": "https://github.com/LysandreJik", "followers_url": "https://api.github.com/users/LysandreJik/followers", "following_url": "https://api.github.com/users/LysandreJik/following{/other_user}", "gists_url": "https://api.github.com/users/LysandreJik/gists{/gist_id}", "starred_url": "https://api.github.com/users/LysandreJik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LysandreJik/subscriptions", "organizations_url": "https://api.github.com/users/LysandreJik/orgs", "repos_url": "https://api.github.com/users/LysandreJik/repos", "events_url": "https://api.github.com/users/LysandreJik/events{/privacy}", "received_events_url": "https://api.github.com/users/LysandreJik/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,589
1,589
1,589
MEMBER
null
closes #4274
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4292/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4292/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4292", "html_url": "https://github.com/huggingface/transformers/pull/4292", "diff_url": "https://github.com/huggingface/transformers/pull/4292.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4292.patch", "merged_at": 1589223937000 }
https://api.github.com/repos/huggingface/transformers/issues/4291
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4291/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4291/comments
https://api.github.com/repos/huggingface/transformers/issues/4291/events
https://github.com/huggingface/transformers/pull/4291
616,077,295
MDExOlB1bGxSZXF1ZXN0NDE2MjU5OTA4
4,291
Fix quickstart
{ "login": "LysandreJik", "id": 30755778, "node_id": "MDQ6VXNlcjMwNzU1Nzc4", "avatar_url": "https://avatars.githubusercontent.com/u/30755778?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LysandreJik", "html_url": "https://github.com/LysandreJik", "followers_url": "https://api.github.com/users/LysandreJik/followers", "following_url": "https://api.github.com/users/LysandreJik/following{/other_user}", "gists_url": "https://api.github.com/users/LysandreJik/gists{/gist_id}", "starred_url": "https://api.github.com/users/LysandreJik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LysandreJik/subscriptions", "organizations_url": "https://api.github.com/users/LysandreJik/orgs", "repos_url": "https://api.github.com/users/LysandreJik/repos", "events_url": "https://api.github.com/users/LysandreJik/events{/privacy}", "received_events_url": "https://api.github.com/users/LysandreJik/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,589
1,591
1,591
MEMBER
null
GPT-2 now requires the entire context to be passed, even when specifying the past since #3734 closes #4259
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4291/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4291/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4291", "html_url": "https://github.com/huggingface/transformers/pull/4291", "diff_url": "https://github.com/huggingface/transformers/pull/4291.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4291.patch", "merged_at": null }
https://api.github.com/repos/huggingface/transformers/issues/4290
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4290/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4290/comments
https://api.github.com/repos/huggingface/transformers/issues/4290/events
https://github.com/huggingface/transformers/pull/4290
616,072,505
MDExOlB1bGxSZXF1ZXN0NDE2MjU2MTUz
4,290
[Marian Fixes] prevent predicting pad_token_id before softmax, support language codes, name multilingual models
{ "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "The slow bart summarization tests all pass with this? ", "yes!", "LGTM", "Correct, @LysandreJik not a breaking change.\r\n", "# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4290?src=pr&el=h1) Report\n> Merging [#4290](https://codecov.io/gh/huggingface/transformers/pull/4290?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/7d7fe4997f83d6d858849a659302b9fdc32c3337&el=desc) will **increase** coverage by `0.06%`.\n> The diff coverage is `95.65%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4290/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4290?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4290 +/- ##\n==========================================\n+ Coverage 78.16% 78.22% +0.06% \n==========================================\n Files 120 120 \n Lines 20005 20013 +8 \n==========================================\n+ Hits 15636 15655 +19 \n+ Misses 4369 4358 -11 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4290?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [src/transformers/modeling\\_marian.py](https://codecov.io/gh/huggingface/transformers/pull/4290/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19tYXJpYW4ucHk=) | `88.88% <75.00%> (+26.38%)` | :arrow_up: |\n| [src/transformers/modeling\\_bart.py](https://codecov.io/gh/huggingface/transformers/pull/4290/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19iYXJ0LnB5) | `96.79% <100.00%> (+0.56%)` | :arrow_up: |\n| [src/transformers/modeling\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4290/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `91.08% <100.00%> (+0.12%)` | :arrow_up: |\n| [src/transformers/tokenization\\_marian.py](https://codecov.io/gh/huggingface/transformers/pull/4290/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90b2tlbml6YXRpb25fbWFyaWFuLnB5) | `87.14% <100.00%> (+6.19%)` | :arrow_up: |\n| [src/transformers/modeling\\_tf\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4290/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `92.77% <0.00%> (+0.16%)` | :arrow_up: |\n| [src/transformers/activations.py](https://codecov.io/gh/huggingface/transformers/pull/4290/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9hY3RpdmF0aW9ucy5weQ==) | `90.00% <0.00%> (+5.00%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4290?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4290?src=pr&el=footer). Last update [7d7fe49...54d704c](https://codecov.io/gh/huggingface/transformers/pull/4290?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "Merging in advance of release tomorrow. Feel free to leave comments and I will fix them!" ]
1,589
1,589
1,589
CONTRIBUTOR
null
(this should probably be 3 PRs, sorry). TLDR: This gets us to equal or better BLEU for 99+% of the converted models. ### Issue 1: non-breaking Generation Issue `pad_token_id` is predicted with score 0, but we never want to generate it. Previously, we set its score to inf after softmax, so probabilities summed to something much less than 1. At the end of long generations, the probabilities got infinitesimally small, and BLEU suffered. Solution: set `logits[:, pad_token_id] = -float('inf')` before calling `log_softmax` Also, renames `prepare_scores_for_generation` -> `prepare_logits_for_generation` because it is now called on logits. - Bart outputs are unchanged, other models unaffected. - This could also be done for other filters, like bad_words_ids, but results may change slightly. - This works fine with fp16 - Improves BLEU scores for 50% of Marian models, often by a huge amount for those with long examples in test set. No change for others models. ### Issue 2 Multilingual Models require language codes. `>>pt<< Don't spend so much time watching TV.` The language code at the beginning, which tells the model to generate in portuguese, is not known to sentencepiece, so `MarianTokenizer` must manually extract it and add it as it's own piece. We do this using `re.match` inside `_tokenize`. ### Issue 3: Opus' Multilingual models have very long names We remap them to much shorter names, like `Helsinki-NLP/opus-mt-en-ROMANCE` in `convert_marian_to_pytorch.py`, and document the naming scheme in `docs/`. ### Working snippet: ``` from transformers import MarianMTModel, MarianTokenizer text = ['>>fr<< this is a sentence in english that we want to translate to french', '>>pt<< This should go to portuguese', '>>es<< And this to Spanish' ] model_name = 'Helsinki-NLP/opus-mt-en-ROMANCE' tokenizer = MarianTokenizer.from_pretrained(model_name) model = MarianMTModel.from_pretrained(model_name) translated = model.generate(**tokenizer.prepare_translation_batch(text)) [tokenizer.decode(t, skip_special_tokens=True) for t in translated] => ["c'est une phrase en anglais que nous voulons traduire en français", 'Isto deve ir para o português.', 'Y esto al español'] ```
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4290/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4290/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4290", "html_url": "https://github.com/huggingface/transformers/pull/4290", "diff_url": "https://github.com/huggingface/transformers/pull/4290.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4290.patch", "merged_at": 1589405382000 }
https://api.github.com/repos/huggingface/transformers/issues/4289
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4289/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4289/comments
https://api.github.com/repos/huggingface/transformers/issues/4289/events
https://github.com/huggingface/transformers/pull/4289
616,039,246
MDExOlB1bGxSZXF1ZXN0NDE2MjMwMTAy
4,289
CamemBERT does not make use of Token Type IDs
{ "login": "LysandreJik", "id": 30755778, "node_id": "MDQ6VXNlcjMwNzU1Nzc4", "avatar_url": "https://avatars.githubusercontent.com/u/30755778?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LysandreJik", "html_url": "https://github.com/LysandreJik", "followers_url": "https://api.github.com/users/LysandreJik/followers", "following_url": "https://api.github.com/users/LysandreJik/following{/other_user}", "gists_url": "https://api.github.com/users/LysandreJik/gists{/gist_id}", "starred_url": "https://api.github.com/users/LysandreJik/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LysandreJik/subscriptions", "organizations_url": "https://api.github.com/users/LysandreJik/orgs", "repos_url": "https://api.github.com/users/LysandreJik/repos", "events_url": "https://api.github.com/users/LysandreJik/events{/privacy}", "received_events_url": "https://api.github.com/users/LysandreJik/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,589
1,589
1,589
MEMBER
null
CamemBERT, like RoBERTa, does not make use of token type IDs. closes https://github.com/huggingface/transformers/issues/4153 closes #4163
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4289/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4289/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4289", "html_url": "https://github.com/huggingface/transformers/pull/4289", "diff_url": "https://github.com/huggingface/transformers/pull/4289.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4289.patch", "merged_at": 1589218263000 }
https://api.github.com/repos/huggingface/transformers/issues/4288
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4288/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4288/comments
https://api.github.com/repos/huggingface/transformers/issues/4288/events
https://github.com/huggingface/transformers/issues/4288
615,977,111
MDU6SXNzdWU2MTU5NzcxMTE=
4,288
TAPAS: Weakly Supervised Table Parsing via Pre-training
{ "login": "TheEdoardo93", "id": 19664571, "node_id": "MDQ6VXNlcjE5NjY0NTcx", "avatar_url": "https://avatars.githubusercontent.com/u/19664571?v=4", "gravatar_id": "", "url": "https://api.github.com/users/TheEdoardo93", "html_url": "https://github.com/TheEdoardo93", "followers_url": "https://api.github.com/users/TheEdoardo93/followers", "following_url": "https://api.github.com/users/TheEdoardo93/following{/other_user}", "gists_url": "https://api.github.com/users/TheEdoardo93/gists{/gist_id}", "starred_url": "https://api.github.com/users/TheEdoardo93/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/TheEdoardo93/subscriptions", "organizations_url": "https://api.github.com/users/TheEdoardo93/orgs", "repos_url": "https://api.github.com/users/TheEdoardo93/repos", "events_url": "https://api.github.com/users/TheEdoardo93/events{/privacy}", "received_events_url": "https://api.github.com/users/TheEdoardo93/received_events", "type": "User", "site_admin": false }
[ { "id": 1843244711, "node_id": "MDU6TGFiZWwxODQzMjQ0NzEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/New%20model", "name": "New model", "color": "fbca04", "default": false, "description": "" } ]
closed
false
null
[]
[ "Duplicated of [https://github.com/huggingface/transformers/issues/4166](url)" ]
1,589
1,589
1,589
NONE
null
# 🌟 TAPAS (Weakly Supervised Table Parsing via Pre-Training) ## Model description **TAPAS** [ArXiV Paper](https://arxiv.org/pdf/2004.02349.pdf) [Google AI Blog](https://ai.googleblog.com/2020/04/using-neural-networks-to-find-answers.html?utm_campaign=Learning%20Posts&utm_content=128690771&utm_medium=social&utm_source=linkedin&hss_channel=lcp-9358547), an approach to question answering over tables without generating logical forms. TAPAS trains from weak supervision, and predicts the denotation by selecting table cells and optionally applying a corresponding aggregation operator to such selection. TAPAS extends BERT’s architecture to encode tables as input, initializes from an effective joint pre-training of text segments and tables crawled from Wikipedia, and is trained end-to-end. We experiment with three different semantic parsing datasets, and find that TAPAS outperforms or rivals semantic parsing models by improving state-of-the-art accuracy on SQA from 55.1 to 67.2 and performing on par with the state-of-the-art on WIKISQL and WIKITQ, but with a simpler model architecture. We additionally find that transfer learning, which is trivial in our setting, from WIKISQL to WIKITQ, yields 48.7 accuracy, 4.2 points above the state-of-the-art. ## Open source status * [ X ] the model implementation is available: [GitHub repo](https://github.com/google-research/tapas/tree/master/tapas/models) * [ X ] the model weights are available: in the "Data" section at [their GitHub page](https://github.com/google-research/tapas) * [ X ] who are the authors: Jonathan Herzig, Paweł Krzysztof Nowak, Thomas Muller, Francesco Piccinno, Julian Martin Eisenschlos
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4288/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4288/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4287
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4287/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4287/comments
https://api.github.com/repos/huggingface/transformers/issues/4287/events
https://github.com/huggingface/transformers/issues/4287
615,917,013
MDU6SXNzdWU2MTU5MTcwMTM=
4,287
T5 fp16 forward yields nan
{ "login": "binshengliu", "id": 441707, "node_id": "MDQ6VXNlcjQ0MTcwNw==", "avatar_url": "https://avatars.githubusercontent.com/u/441707?v=4", "gravatar_id": "", "url": "https://api.github.com/users/binshengliu", "html_url": "https://github.com/binshengliu", "followers_url": "https://api.github.com/users/binshengliu/followers", "following_url": "https://api.github.com/users/binshengliu/following{/other_user}", "gists_url": "https://api.github.com/users/binshengliu/gists{/gist_id}", "starred_url": "https://api.github.com/users/binshengliu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/binshengliu/subscriptions", "organizations_url": "https://api.github.com/users/binshengliu/orgs", "repos_url": "https://api.github.com/users/binshengliu/repos", "events_url": "https://api.github.com/users/binshengliu/events{/privacy}", "received_events_url": "https://api.github.com/users/binshengliu/received_events", "type": "User", "site_admin": false }
[]
closed
false
{ "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false }
[ { "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false } ]
[ "Thanks for the detailed error description @binshengliu! I linked a PR that should fix it :-) ", "Hi, there's still some chance we get `nan` values during training. It does not always happen but is still pretty easy to reproduce. My current version is `2.11.0`.\r\n\r\n```\r\nimport torch\r\nfrom transformers import T5Model, T5Tokenizer\r\n\r\ntorch.manual_seed(0)\r\ntokenizer = T5Tokenizer.from_pretrained(\"t5-base\")\r\nmodel = T5Model.from_pretrained(\"t5-base\").cuda().half()\r\ntext = \"hello world!\"\r\nmodel.train()\r\ninputs = tokenizer.encode(text, return_tensors=\"pt\").cuda()\r\nfor idx in range(1000):\r\n out = model(input_ids=inputs, decoder_input_ids=inputs)\r\n if torch.isnan(out[0]).any():\r\n print(idx)\r\n print(out[0][:, :, :10])\r\n exit()\r\n```\r\n\r\nOutput:\r\n```\r\n143\r\ntensor([[[nan, nan, nan, nan, nan, nan, nan, nan, nan, 0.],\r\n [nan, nan, nan, 0., nan, nan, nan, nan, nan, 0.],\r\n [nan, nan, 0., nan, nan, 0., 0., 0., nan, nan]]], device='cuda:0',\r\n dtype=torch.float16, grad_fn=<SliceBackward>)\r\n```", "Sorry I just noticed you commented https://github.com/huggingface/transformers/issues/4586#issuecomment-639704855. I can confirm the issue I encountered is caused by the same reason.", "Hi, I have the same problem. I get NAN when using fp16. And when I set fp16=False, the NAN problem is gone. ", "Yeah that's still an open problem....not sure how easy it will be to solve it, see: https://github.com/huggingface/transformers/issues/4586#issuecomment-639704855", "Same when fine-tuning GPT Neo." ]
1,589
1,625
1,589
NONE
null
# 🐛 Bug ## Information Model I am using (Bert, XLNet ...): T5 Language I am using the model on (English, Chinese ...): English The problem arises when using: * [ ] the official example scripts: (give details below) * [x] my own modified scripts: (give details below) The tasks I am working on is: * [ ] an official GLUE/SQUaD task: (give the name) * [x] my own task or dataset: (give details below) ## To reproduce <!-- If you have code snippets, error messages, stack traces please provide them here as well. Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.--> I use pytorch-lightning to manage fp16. This is the minimal example that reproduces the result. ```python from transformers import T5Model, T5Tokenizer tokenizer = T5Tokenizer.from_pretrained("t5-base") model = T5Model.from_pretrained("t5-base").cuda().half() text = "hello world!" inputs = tokenizer.encode(text, return_tensors="pt").cuda() out = model(input_ids=inputs, decoder_input_ids=inputs) print(out[0][:, :, :10]) ``` output: ``` tensor([[[nan, nan, nan, nan, nan, nan, nan, nan, nan, nan], [nan, nan, nan, nan, nan, nan, nan, nan, nan, nan], [nan, nan, nan, nan, nan, nan, nan, nan, nan, nan]]], device='cuda:0', dtype=torch.float16, grad_fn=<SliceBackward>) ``` ## Expected behavior <!-- A clear and concise description of what you would expect to happen. --> Get non-nan values. ## Environment info <!-- You can run the command `transformers-cli env` and copy-and-paste its output below. Don't forget to fill out the missing fields in that output! --> - `transformers` version: 2.9.0 - Platform: Linux-4.15.0-88-generic-x86_64-with-debian-buster-sid - Python version: 3.7.6 - PyTorch version (GPU?): 1.4.0 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4287/reactions", "total_count": 5, "+1": 5, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4287/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4286
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4286/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4286/comments
https://api.github.com/repos/huggingface/transformers/issues/4286/events
https://github.com/huggingface/transformers/pull/4286
615,916,697
MDExOlB1bGxSZXF1ZXN0NDE2MTMwODc2
4,286
Reformer enwik8 - Model card
{ "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false }
[ { "id": 1838412367, "node_id": "MDU6TGFiZWwxODM4NDEyMzY3", "url": "https://api.github.com/repos/huggingface/transformers/labels/model%20card", "name": "model card", "color": "92d5f4", "default": false, "description": "Related to pretrained model cards" } ]
closed
false
null
[]
[]
1,589
1,589
1,589
MEMBER
null
Create a model card with char level tokenizer for reformer enwik8.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4286/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4286/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4286", "html_url": "https://github.com/huggingface/transformers/pull/4286", "diff_url": "https://github.com/huggingface/transformers/pull/4286.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4286.patch", "merged_at": 1589206928000 }
https://api.github.com/repos/huggingface/transformers/issues/4285
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4285/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4285/comments
https://api.github.com/repos/huggingface/transformers/issues/4285/events
https://github.com/huggingface/transformers/issues/4285
615,903,544
MDU6SXNzdWU2MTU5MDM1NDQ=
4,285
Default code snippet for shared model doesn't work because of different model and tokenizer types
{ "login": "obsh", "id": 1974420, "node_id": "MDQ6VXNlcjE5NzQ0MjA=", "avatar_url": "https://avatars.githubusercontent.com/u/1974420?v=4", "gravatar_id": "", "url": "https://api.github.com/users/obsh", "html_url": "https://github.com/obsh", "followers_url": "https://api.github.com/users/obsh/followers", "following_url": "https://api.github.com/users/obsh/following{/other_user}", "gists_url": "https://api.github.com/users/obsh/gists{/gist_id}", "starred_url": "https://api.github.com/users/obsh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/obsh/subscriptions", "organizations_url": "https://api.github.com/users/obsh/orgs", "repos_url": "https://api.github.com/users/obsh/repos", "events_url": "https://api.github.com/users/obsh/events{/privacy}", "received_events_url": "https://api.github.com/users/obsh/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n", "I have the exact same issue. When I share GPT2 model trained with AlbertTokenizer on huggingface.co the default code snippet doesn't work. The reason is that AutoTokenizer detects tokenizer type by model type. Is there any workaround?", "Hi @obsh and @khashei – yes you need to add a `tokenizer_class` attribute to your model's config.json:\r\n\r\n> tokenizer_class (str, optional) – The name of the associated tokenizer class to use (if none is set, will use the tokenizer associated to the model by default).\r\n\r\nhttps://huggingface.co/transformers/main_classes/configuration.html\r\n\r\ncc @patrickvonplaten " ]
1,589
1,608
1,595
CONTRIBUTOR
null
# 🐛 Bug ## Information Model I am using (Bert, XLNet ...): GPT2 with AlbertTokenizer Language I am using the model on (English, Chinese ...): Ukrainian The problem arises when using: * [x] the official example scripts: (give details below) * [ ] my own modified scripts: (give details below) The tasks I am working on is: * [ ] an official GLUE/SQUaD task: (give the name) * [x] my own task or dataset: (give details below) When I share GPT2 model trained with AlbertTokenizer on huggingface.co the default code snippet doesn't work. The reason is that AutoTokenizer detects tokenizer type by model type. ## To reproduce Steps to reproduce the behavior: 1. Go to https://huggingface.co/Tereveni-AI/gpt2-124M-uk-fiction 2. Copy code from default snippet `How to use this model directly from the 🤗/transformers library` 3. Try to execute snippet code ``` >>> from transformers import AutoTokenizer, AutoModel >>> tokenizer = AutoTokenizer.from_pretrained("Tereveni-AI/gpt2-124M-uk-fiction") Downloading: 100%|████████████████████████████████████████████████████████████████████████████| 645/645 [00:00<00:00, 89.4kB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████| 121/121 [00:00<00:00, 18.8kB/s] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/oleksandrbushkovskyi/Projects/transformers-ua/venv/lib/python3.7/site-packages/transformers/tokenization_auto.py", line 200, in from_pretrained return tokenizer_class_py.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs) File "/Users/oleksandrbushkovskyi/Projects/transformers-ua/venv/lib/python3.7/site-packages/transformers/tokenization_utils.py", line 898, in from_pretrained return cls._from_pretrained(*inputs, **kwargs) File "/Users/oleksandrbushkovskyi/Projects/transformers-ua/venv/lib/python3.7/site-packages/transformers/tokenization_utils.py", line 1051, in _from_pretrained tokenizer = cls(*init_inputs, **init_kwargs) File "/Users/oleksandrbushkovskyi/Projects/transformers-ua/venv/lib/python3.7/site-packages/transformers/tokenization_gpt2.py", line 151, in __init__ with open(vocab_file, encoding="utf-8") as vocab_handle: TypeError: expected str, bytes or os.PathLike object, not NoneType ``` ## Expected behavior I would expect `AutoTokenizer` to detect `spiece.model` and initialize `AlbertTokenizer`. Even better if `AutoTokenizer` read tokenizer type explicitly defined in `tokenizer_config.json`. ## Environment info - `transformers` version: 2.9.0 - Platform: Darwin-19.4.0-x86_64-i386-64bit - Python version: 3.7.7 - PyTorch version (GPU?): 1.5.0 (False) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: no - Using distributed or parallel set-up in script?: no
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4285/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4285/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4284
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4284/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4284/comments
https://api.github.com/repos/huggingface/transformers/issues/4284/events
https://github.com/huggingface/transformers/pull/4284
615,888,541
MDExOlB1bGxSZXF1ZXN0NDE2MTA3ODgy
4,284
[Marian] Fix typo in docstring
{ "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,589
1,589
1,589
CONTRIBUTOR
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4284/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4284/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4284", "html_url": "https://github.com/huggingface/transformers/pull/4284", "diff_url": "https://github.com/huggingface/transformers/pull/4284.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4284.patch", "merged_at": 1589212071000 }
https://api.github.com/repos/huggingface/transformers/issues/4283
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4283/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4283/comments
https://api.github.com/repos/huggingface/transformers/issues/4283/events
https://github.com/huggingface/transformers/pull/4283
615,880,564
MDExOlB1bGxSZXF1ZXN0NDE2MTAxMzE1
4,283
[TF 2.2 compat] use tf.VariableAggregation.ONLY_FIRST_REPLICA
{ "login": "jplu", "id": 959590, "node_id": "MDQ6VXNlcjk1OTU5MA==", "avatar_url": "https://avatars.githubusercontent.com/u/959590?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jplu", "html_url": "https://github.com/jplu", "followers_url": "https://api.github.com/users/jplu/followers", "following_url": "https://api.github.com/users/jplu/following{/other_user}", "gists_url": "https://api.github.com/users/jplu/gists{/gist_id}", "starred_url": "https://api.github.com/users/jplu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jplu/subscriptions", "organizations_url": "https://api.github.com/users/jplu/orgs", "repos_url": "https://api.github.com/users/jplu/repos", "events_url": "https://api.github.com/users/jplu/events{/privacy}", "received_events_url": "https://api.github.com/users/jplu/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "Good to be merged for me :) We should update the `setup.py` in same time to do not limit anymore to TF 2.1. Should it be done in this PR? /cc @julien-c @LysandreJik ", "I think you can cc @LysandreJik @julien-c ", "Yes can you do it in the same PR? and it'll be ready to merge.", "Nice! Unfortunately there are other issues with TF2.2, hence why the tests fail and why the version was pinned. I'm patching it now.", "Yep I think @mfuntowicz is working on it as it is related to the Tokenizer. At least we have identified why it is not working :)" ]
1,589
1,589
1,589
CONTRIBUTOR
null
This PR updates the TF gradient accumulator optimization to make it compliant with the new TF 2.2.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4283/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4283/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4283", "html_url": "https://github.com/huggingface/transformers/pull/4283", "diff_url": "https://github.com/huggingface/transformers/pull/4283.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4283.patch", "merged_at": 1589210918000 }
https://api.github.com/repos/huggingface/transformers/issues/4282
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4282/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4282/comments
https://api.github.com/repos/huggingface/transformers/issues/4282/events
https://github.com/huggingface/transformers/pull/4282
615,859,029
MDExOlB1bGxSZXF1ZXN0NDE2MDgzNjc3
4,282
[Reformer] Add Enwiki8 Reformer Model - Adapt convert script
{ "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4282?src=pr&el=h1) Report\n> Merging [#4282](https://codecov.io/gh/huggingface/transformers/pull/4282?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/b290c32e1617fa74f44ccd8b83365fe764437be9&el=desc) will **increase** coverage by `0.01%`.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4282/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4282?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4282 +/- ##\n==========================================\n+ Coverage 78.39% 78.40% +0.01% \n==========================================\n Files 120 120 \n Lines 19932 19932 \n==========================================\n+ Hits 15626 15628 +2 \n+ Misses 4306 4304 -2 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4282?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [src/transformers/modeling\\_tf\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4282/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `93.10% <0.00%> (+0.16%)` | :arrow_up: |\n| [src/transformers/file\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4282/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `74.38% <0.00%> (+0.41%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4282?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4282?src=pr&el=footer). Last update [b290c32...5babcfc](https://codecov.io/gh/huggingface/transformers/pull/4282?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n" ]
1,589
1,589
1,589
MEMBER
null
This PR adapts the reformer conversion script to the newest trax code and adds `reformer-enwik8` to the docs.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4282/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4282/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4282", "html_url": "https://github.com/huggingface/transformers/pull/4282", "diff_url": "https://github.com/huggingface/transformers/pull/4282.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4282.patch", "merged_at": 1589207887000 }
https://api.github.com/repos/huggingface/transformers/issues/4281
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4281/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4281/comments
https://api.github.com/repos/huggingface/transformers/issues/4281/events
https://github.com/huggingface/transformers/pull/4281
615,850,656
MDExOlB1bGxSZXF1ZXN0NDE2MDc2ODcx
4,281
Model card for bert-turkish-question-answering question-answering model
{ "login": "lserinol", "id": 13028689, "node_id": "MDQ6VXNlcjEzMDI4Njg5", "avatar_url": "https://avatars.githubusercontent.com/u/13028689?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lserinol", "html_url": "https://github.com/lserinol", "followers_url": "https://api.github.com/users/lserinol/followers", "following_url": "https://api.github.com/users/lserinol/following{/other_user}", "gists_url": "https://api.github.com/users/lserinol/gists{/gist_id}", "starred_url": "https://api.github.com/users/lserinol/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lserinol/subscriptions", "organizations_url": "https://api.github.com/users/lserinol/orgs", "repos_url": "https://api.github.com/users/lserinol/repos", "events_url": "https://api.github.com/users/lserinol/events{/privacy}", "received_events_url": "https://api.github.com/users/lserinol/received_events", "type": "User", "site_admin": false }
[ { "id": 1838412367, "node_id": "MDU6TGFiZWwxODM4NDEyMzY3", "url": "https://api.github.com/repos/huggingface/transformers/labels/model%20card", "name": "model card", "color": "92d5f4", "default": false, "description": "Related to pretrained model cards" } ]
closed
false
null
[]
[ "# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4281?src=pr&el=h1) Report\n> Merging [#4281](https://codecov.io/gh/huggingface/transformers/pull/4281?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/b290c32e1617fa74f44ccd8b83365fe764437be9&el=desc) will **decrease** coverage by `0.00%`.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4281/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4281?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4281 +/- ##\n==========================================\n- Coverage 78.39% 78.39% -0.01% \n==========================================\n Files 120 120 \n Lines 19932 19932 \n==========================================\n- Hits 15626 15625 -1 \n- Misses 4306 4307 +1 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4281?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [src/transformers/modeling\\_tf\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4281/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `92.77% <0.00%> (-0.17%)` | :arrow_down: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4281?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4281?src=pr&el=footer). Last update [b290c32...2222fd5](https://codecov.io/gh/huggingface/transformers/pull/4281?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "Awesome, thanks for sharing! Did you fine-tune https://huggingface.co/dbmdz/bert-base-turkish-cased?\r\n\r\n cc @stefan-it ", "[Model page](https://huggingface.co/lserinol/bert-turkish-question-answering)", "> Awesome, thanks for sharing! Did you fine-tune https://huggingface.co/dbmdz/bert-base-turkish-cased?\r\n> \r\n> cc @stefan-it\r\n\r\nYes" ]
1,589
1,589
1,589
CONTRIBUTOR
null
First model card for bert-turkish-question-answering question-answering model
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4281/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4281/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4281", "html_url": "https://github.com/huggingface/transformers/pull/4281", "diff_url": "https://github.com/huggingface/transformers/pull/4281.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4281.patch", "merged_at": 1589211145000 }
https://api.github.com/repos/huggingface/transformers/issues/4280
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4280/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4280/comments
https://api.github.com/repos/huggingface/transformers/issues/4280/events
https://github.com/huggingface/transformers/pull/4280
615,842,026
MDExOlB1bGxSZXF1ZXN0NDE2MDY5NzY4
4,280
Update model-card
{ "login": "jplu", "id": 959590, "node_id": "MDQ6VXNlcjk1OTU5MA==", "avatar_url": "https://avatars.githubusercontent.com/u/959590?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jplu", "html_url": "https://github.com/jplu", "followers_url": "https://api.github.com/users/jplu/followers", "following_url": "https://api.github.com/users/jplu/following{/other_user}", "gists_url": "https://api.github.com/users/jplu/gists{/gist_id}", "starred_url": "https://api.github.com/users/jplu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jplu/subscriptions", "organizations_url": "https://api.github.com/users/jplu/orgs", "repos_url": "https://api.github.com/users/jplu/repos", "events_url": "https://api.github.com/users/jplu/events{/privacy}", "received_events_url": "https://api.github.com/users/jplu/received_events", "type": "User", "site_admin": false }
[ { "id": 1838412367, "node_id": "MDU6TGFiZWwxODM4NDEyMzY3", "url": "https://api.github.com/repos/huggingface/transformers/labels/model%20card", "name": "model card", "color": "92d5f4", "default": false, "description": "Related to pretrained model cards" } ]
closed
false
null
[]
[]
1,589
1,589
1,589
CONTRIBUTOR
null
This PR is to: - Fix the XTREME link. - add the number of evaluation documents for each language. - fix the usage piece of code to specify which framework to use.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4280/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4280/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4280", "html_url": "https://github.com/huggingface/transformers/pull/4280", "diff_url": "https://github.com/huggingface/transformers/pull/4280.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4280.patch", "merged_at": 1589210651000 }
https://api.github.com/repos/huggingface/transformers/issues/4279
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4279/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4279/comments
https://api.github.com/repos/huggingface/transformers/issues/4279/events
https://github.com/huggingface/transformers/pull/4279
615,749,989
MDExOlB1bGxSZXF1ZXN0NDE1OTkzNTYx
4,279
Documentation: fix links to NER examples
{ "login": "stefan-it", "id": 20651387, "node_id": "MDQ6VXNlcjIwNjUxMzg3", "avatar_url": "https://avatars.githubusercontent.com/u/20651387?v=4", "gravatar_id": "", "url": "https://api.github.com/users/stefan-it", "html_url": "https://github.com/stefan-it", "followers_url": "https://api.github.com/users/stefan-it/followers", "following_url": "https://api.github.com/users/stefan-it/following{/other_user}", "gists_url": "https://api.github.com/users/stefan-it/gists{/gist_id}", "starred_url": "https://api.github.com/users/stefan-it/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stefan-it/subscriptions", "organizations_url": "https://api.github.com/users/stefan-it/orgs", "repos_url": "https://api.github.com/users/stefan-it/repos", "events_url": "https://api.github.com/users/stefan-it/events{/privacy}", "received_events_url": "https://api.github.com/users/stefan-it/received_events", "type": "User", "site_admin": false }
[ { "id": 1834067346, "node_id": "MDU6TGFiZWwxODM0MDY3MzQ2", "url": "https://api.github.com/repos/huggingface/transformers/labels/Documentation", "name": "Documentation", "color": "77cc3b", "default": false, "description": "" } ]
closed
false
null
[]
[ "👍 \r\n" ]
1,589
1,589
1,589
COLLABORATOR
null
Hi, this PR just fixes some links related to the NER examples :)
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4279/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4279/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4279", "html_url": "https://github.com/huggingface/transformers/pull/4279", "diff_url": "https://github.com/huggingface/transformers/pull/4279.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4279.patch", "merged_at": 1589215701000 }
https://api.github.com/repos/huggingface/transformers/issues/4278
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4278/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4278/comments
https://api.github.com/repos/huggingface/transformers/issues/4278/events
https://github.com/huggingface/transformers/issues/4278
615,663,406
MDU6SXNzdWU2MTU2NjM0MDY=
4,278
Could you help with a huggingface/transformers pretrained models download link?
{ "login": "yucc2018", "id": 13469346, "node_id": "MDQ6VXNlcjEzNDY5MzQ2", "avatar_url": "https://avatars.githubusercontent.com/u/13469346?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yucc2018", "html_url": "https://github.com/yucc2018", "followers_url": "https://api.github.com/users/yucc2018/followers", "following_url": "https://api.github.com/users/yucc2018/following{/other_user}", "gists_url": "https://api.github.com/users/yucc2018/gists{/gist_id}", "starred_url": "https://api.github.com/users/yucc2018/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yucc2018/subscriptions", "organizations_url": "https://api.github.com/users/yucc2018/orgs", "repos_url": "https://api.github.com/users/yucc2018/repos", "events_url": "https://api.github.com/users/yucc2018/events{/privacy}", "received_events_url": "https://api.github.com/users/yucc2018/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "Hi, you can find the model identifiers in this JSON: https://huggingface.co/api/models\r\n\r\nThen you can get all files URLs by removing `bert/` from the objects' keys and prefixing with URL endpoint \"https://cdn.huggingface.co/\"", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,595
1,595
NONE
null
# ❓ Questions & Help <!-- The GitHub issue tracker is primarly intended for bugs, feature requests, new models and benchmarks, and migration questions. For all other questions, we direct you to Stack Overflow (SO) where a whole community of PyTorch and Tensorflow enthusiast can help you out. Make sure to tag your question with the right deep learning framework as well as the huggingface-transformers tag: https://stackoverflow.com/questions/tagged/huggingface-transformers If your question wasn't answered after a period of time on Stack Overflow, you can always open a question on GitHub. You should then link to the SO question that you posted. --> ## Details <!-- Description of your issue --> I am a natural language processing researcher from the Lenovo Research in Beijing. My colleagues and I really like your huggingface/transfromers framework and having been using it. I am currently writing a series of Chinese blogs about transformers, hoping to promote it to more Chinese friends. I want to download all of your pretrained models for study and experiments, but due to network problems in China, the download will be very slow and unstable. At the same time, manual downloading one by one is very troublesome. Could you kindly provide a unified download link which I can download all models? Thank you. @julien-c <!-- You should first ask your question on SO, and only if you didn't get an answer ask it here on GitHub. -->
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4278/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4278/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4277
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4277/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4277/comments
https://api.github.com/repos/huggingface/transformers/issues/4277/events
https://github.com/huggingface/transformers/issues/4277
615,647,775
MDU6SXNzdWU2MTU2NDc3NzU=
4,277
Use BART for longer documents
{ "login": "tuhinjubcse", "id": 3104771, "node_id": "MDQ6VXNlcjMxMDQ3NzE=", "avatar_url": "https://avatars.githubusercontent.com/u/3104771?v=4", "gravatar_id": "", "url": "https://api.github.com/users/tuhinjubcse", "html_url": "https://github.com/tuhinjubcse", "followers_url": "https://api.github.com/users/tuhinjubcse/followers", "following_url": "https://api.github.com/users/tuhinjubcse/following{/other_user}", "gists_url": "https://api.github.com/users/tuhinjubcse/gists{/gist_id}", "starred_url": "https://api.github.com/users/tuhinjubcse/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tuhinjubcse/subscriptions", "organizations_url": "https://api.github.com/users/tuhinjubcse/orgs", "repos_url": "https://api.github.com/users/tuhinjubcse/repos", "events_url": "https://api.github.com/users/tuhinjubcse/events{/privacy}", "received_events_url": "https://api.github.com/users/tuhinjubcse/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "@thomwolf @sshleifer ", "Yeah, here is working code for the copy approach, starting with bart-large-cnn weights.\r\n\r\n```python\r\nfrom copy import deepcopy\r\nfrom transformers import BartForConditionalGeneration\r\n\r\n# Get original model\r\nmodel = BartForConditionalGeneration.from_pretrained('bart-large-cnn')\r\n\r\nsd = model.state_dict()\r\n\r\nshorter_pos_embeds = sd['model.encoder.embed_positions.weight']\r\nnew_config = model.config\r\nnew_config.max_position_embeddings = 2048\r\nnew_model = BartForConditionalGeneration(new_config)\r\n# If you want to learn everything from scratch, you can stop here.\r\ncorrectly_shaped_pos_weight = new_model.model.encoder.embed_positions.weight\r\n\r\ncorrectly_shaped_pos_weight[:shorter_pos_embeds.shape[0]] = shorter_pos_embeds\r\n\r\nsd['model.decoder.embed_positions.weight'] = correctly_shaped_pos_weight\r\nsd['model.encoder.embed_positions.weight'] = correctly_shaped_pos_weight\r\n\r\nnew_model.load_state_dict(sd, strict=True)\r\n```", "@sshleifer \r\nCan we use this same approach for T5 as well ?", "Does it make sense to initialize the weights by copying the first 512 weights multiple times ? \r\n\r\nLike : `[[0:512], [0:512], [0:512], [0:512]]`\r\n\r\nSo the model just have to learn the \"relativeness\" between positions ? ", "I am editing finetune.py \r\n```\r\n model = SummarizationTrainer(args)\r\n sd = model.model.state_dict()\r\n shorter_pos_embeds = sd['model.encoder.embed_positions.weight']\r\n new_config = model.config\r\n new_config.max_position_embeddings = 4096\r\n new_model = BartForConditionalGeneration(new_config)\r\n correctly_shaped_pos_weight = new_model.model.encoder.embed_positions.weight\r\n correctly_shaped_pos_weight[:shorter_pos_embeds.shape[0]] = shorter_pos_embeds\r\n sd['model.decoder.embed_positions.weight'] = correctly_shaped_pos_weight\r\n sd['model.encoder.embed_positions.weight'] = correctly_shaped_pos_weight\r\n new_model.load_state_dict(sd, strict=True)\r\n model.model = new_model.cuda()\r\n trainer = generic_train(model, args)\r\n```\r\n\r\n\r\n```\r\nINFO:transformers.tokenization_utils:loading file https://s3.amazonaws.com/models.huggingface.co/bert/roberta-large-vocab.json from cache at /u/tuhin1/.cache/torch/transformers/1ae1f5b6e2b22b25ccc04c000bb79ca847aa226d0761536b011cf7e5868f0655.ef00af9e673c7160b4d41cfda1f48c5f4cba57d5142754525572a846a1ab1b9b\r\nINFO:transformers.tokenization_utils:loading file https://s3.amazonaws.com/models.huggingface.co/bert/roberta-large-merges.txt from cache at /u/tuhin1/.cache/torch/transformers/f8f83199a6270d582d6245dc100e99c4155de81c9745c6248077018fe01abcfb.70bec105b4158ed9a1747fea67a43f5dee97855c64d62b6ec3742f4cfdb5feda\r\nINFO:transformers.modeling_utils:loading weights file https://cdn.huggingface.co/facebook/bart-large/pytorch_model.bin from cache at /u/tuhin1/.cache/torch/transformers/2e7cae41bb1dd1f18e498ff4ff0ea85f7e9bc2b637439e2d95c485c5d5bdd579.5be2a88ec29f5969270f98902db392beab8be8a6a7ecc588d410ada3e32c4263\r\nINFO:transformers.modeling_utils:Weights of BartForConditionalGeneration not initialized from pretrained model: ['final_logits_bias']\r\nINFO:transformers.modeling_utils:Weights from pretrained model not used in BartForConditionalGeneration: ['encoder.version', 'decoder.version']\r\nINFO:lightning:GPU available: True, used: True\r\nINFO:lightning:CUDA_VISIBLE_DEVICES: [0]\r\nINFO:lightning:Using 16bit precision.\r\n/dccstor/tuhinstor/condatuhin/envs/BARTQA/lib/python3.7/site-packages/pytorch_lightning/utilities/distributed.py:23: RuntimeWarning: You have defined a `val_dataloader()` and have defined a `validation_step()`, you may also want to define `validation_epoch_end()` for accumulating stats.\r\n warnings.warn(*args, **kwargs)\r\nTraceback (most recent call last):\r\n File \"/dccstor/tuhinstor/transformers/examples/finetune1.py\", line 196, in <module>\r\n main(args)\r\n File \"/dccstor/tuhinstor/transformers/examples/finetune1.py\", line 177, in main\r\n trainer = generic_train(model, args)\r\n File \"/dccstor/tuhinstor/transformers/examples/lightning_base.py\", line 278, in generic_train\r\n trainer.fit(model)\r\n File \"/dccstor/tuhinstor/condatuhin/envs/BARTQA/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py\", line 765, in fit\r\n self.single_gpu_train(model)\r\n File \"/dccstor/tuhinstor/condatuhin/envs/BARTQA/lib/python3.7/site-packages/pytorch_lightning/trainer/distrib_parts.py\", line 484, in single_gpu_train\r\n self.optimizers, self.lr_schedulers, self.optimizer_frequencies = self.init_optimizers(model)\r\n File \"/dccstor/tuhinstor/condatuhin/envs/BARTQA/lib/python3.7/site-packages/pytorch_lightning/trainer/optimizers.py\", line 18, in init_optimizers\r\n optim_conf = model.configure_optimizers()\r\n File \"/dccstor/tuhinstor/transformers/examples/lightning_base.py\", line 87, in configure_optimizers\r\n optimizer = AdamW(optimizer_grouped_parameters, lr=self.hparams.learning_rate, eps=self.hparams.adam_epsilon)\r\n File \"/dccstor/tuhinstor/transformers/src/transformers/optimization.py\", line 117, in __init__\r\n super().__init__(params, defaults)\r\n File \"/dccstor/tuhinstor/condatuhin/envs/BARTQA/lib/python3.7/site-packages/torch/optim/optimizer.py\", line 51, in __init__\r\n self.add_param_group(param_group)\r\n File \"/dccstor/tuhinstor/condatuhin/envs/BARTQA/lib/python3.7/site-packages/torch/optim/optimizer.py\", line 202, in add_param_group\r\n raise ValueError(\"can't optimize a non-leaf Tensor\")\r\nValueError: can't optimize a non-leaf Tensor\r\n```\r\n\r\nAny idea to resolve this @sshleifer", "Update I fixed it\r\n ```\r\n model = SummarizationTrainer(args)\r\n sd = model.model.state_dict()\r\n shorter_pos_embeds = sd['model.encoder.embed_positions.weight']\r\n new_config = model.config\r\n new_config.max_position_embeddings = 3000\r\n new_model = BartForConditionalGeneration(new_config)\r\n correctly_shaped_pos_weight = new_model.model.encoder.embed_positions.weight.cuda()\r\n correctly_shaped_pos_weight[:shorter_pos_embeds.shape[0]] = shorter_pos_embeds.cuda()\r\n sd['model.decoder.embed_positions.weight'] = correctly_shaped_pos_weight\r\n sd['model.encoder.embed_positions.weight'] = correctly_shaped_pos_weight\r\n new_model.load_state_dict(sd, strict=True)\r\n model.model = new_model.cuda()\r\n trainer = generic_train(model, args)\r\n```\r\n\r\nHowever i get OOM , I have a 32 GB NVIDIA V100 , i feel it caches a bit too much any work around ?\r\nRuntimeError: CUDA out of memory. Tried to allocate 550.00 MiB (GPU 0; 31.72 GiB total capacity; 26.46 GiB already allocated; 81.88 MiB free; **4.04 GiB cached**)", "My batch size is 1", "@tuhinjubcse could you solve the OOM error? is it possible for you to share your working script for finetuning with longer sequence? appreciate it.", "> I am editing finetune.py\r\n> \r\n> ```\r\n> model = SummarizationTrainer(args)\r\n> sd = model.model.state_dict()\r\n> shorter_pos_embeds = sd['model.encoder.embed_positions.weight']\r\n> new_config = model.config\r\n> new_config.max_position_embeddings = 4096\r\n> new_model = BartForConditionalGeneration(new_config)\r\n> correctly_shaped_pos_weight = new_model.model.encoder.embed_positions.weight\r\n> correctly_shaped_pos_weight[:shorter_pos_embeds.shape[0]] = shorter_pos_embeds\r\n> sd['model.decoder.embed_positions.weight'] = correctly_shaped_pos_weight\r\n> sd['model.encoder.embed_positions.weight'] = correctly_shaped_pos_weight\r\n> new_model.load_state_dict(sd, strict=True)\r\n> model.model = new_model.cuda()\r\n> trainer = generic_train(model, args)\r\n> ```\r\n> \r\n> ```\r\n> INFO:transformers.tokenization_utils:loading file https://s3.amazonaws.com/models.huggingface.co/bert/roberta-large-vocab.json from cache at /u/tuhin1/.cache/torch/transformers/1ae1f5b6e2b22b25ccc04c000bb79ca847aa226d0761536b011cf7e5868f0655.ef00af9e673c7160b4d41cfda1f48c5f4cba57d5142754525572a846a1ab1b9b\r\n> INFO:transformers.tokenization_utils:loading file https://s3.amazonaws.com/models.huggingface.co/bert/roberta-large-merges.txt from cache at /u/tuhin1/.cache/torch/transformers/f8f83199a6270d582d6245dc100e99c4155de81c9745c6248077018fe01abcfb.70bec105b4158ed9a1747fea67a43f5dee97855c64d62b6ec3742f4cfdb5feda\r\n> INFO:transformers.modeling_utils:loading weights file https://cdn.huggingface.co/facebook/bart-large/pytorch_model.bin from cache at /u/tuhin1/.cache/torch/transformers/2e7cae41bb1dd1f18e498ff4ff0ea85f7e9bc2b637439e2d95c485c5d5bdd579.5be2a88ec29f5969270f98902db392beab8be8a6a7ecc588d410ada3e32c4263\r\n> INFO:transformers.modeling_utils:Weights of BartForConditionalGeneration not initialized from pretrained model: ['final_logits_bias']\r\n> INFO:transformers.modeling_utils:Weights from pretrained model not used in BartForConditionalGeneration: ['encoder.version', 'decoder.version']\r\n> INFO:lightning:GPU available: True, used: True\r\n> INFO:lightning:CUDA_VISIBLE_DEVICES: [0]\r\n> INFO:lightning:Using 16bit precision.\r\n> /dccstor/tuhinstor/condatuhin/envs/BARTQA/lib/python3.7/site-packages/pytorch_lightning/utilities/distributed.py:23: RuntimeWarning: You have defined a `val_dataloader()` and have defined a `validation_step()`, you may also want to define `validation_epoch_end()` for accumulating stats.\r\n> warnings.warn(*args, **kwargs)\r\n> Traceback (most recent call last):\r\n> File \"/dccstor/tuhinstor/transformers/examples/finetune1.py\", line 196, in <module>\r\n> main(args)\r\n> File \"/dccstor/tuhinstor/transformers/examples/finetune1.py\", line 177, in main\r\n> trainer = generic_train(model, args)\r\n> File \"/dccstor/tuhinstor/transformers/examples/lightning_base.py\", line 278, in generic_train\r\n> trainer.fit(model)\r\n> File \"/dccstor/tuhinstor/condatuhin/envs/BARTQA/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py\", line 765, in fit\r\n> self.single_gpu_train(model)\r\n> File \"/dccstor/tuhinstor/condatuhin/envs/BARTQA/lib/python3.7/site-packages/pytorch_lightning/trainer/distrib_parts.py\", line 484, in single_gpu_train\r\n> self.optimizers, self.lr_schedulers, self.optimizer_frequencies = self.init_optimizers(model)\r\n> File \"/dccstor/tuhinstor/condatuhin/envs/BARTQA/lib/python3.7/site-packages/pytorch_lightning/trainer/optimizers.py\", line 18, in init_optimizers\r\n> optim_conf = model.configure_optimizers()\r\n> File \"/dccstor/tuhinstor/transformers/examples/lightning_base.py\", line 87, in configure_optimizers\r\n> optimizer = AdamW(optimizer_grouped_parameters, lr=self.hparams.learning_rate, eps=self.hparams.adam_epsilon)\r\n> File \"/dccstor/tuhinstor/transformers/src/transformers/optimization.py\", line 117, in __init__\r\n> super().__init__(params, defaults)\r\n> File \"/dccstor/tuhinstor/condatuhin/envs/BARTQA/lib/python3.7/site-packages/torch/optim/optimizer.py\", line 51, in __init__\r\n> self.add_param_group(param_group)\r\n> File \"/dccstor/tuhinstor/condatuhin/envs/BARTQA/lib/python3.7/site-packages/torch/optim/optimizer.py\", line 202, in add_param_group\r\n> raise ValueError(\"can't optimize a non-leaf Tensor\")\r\n> ValueError: can't optimize a non-leaf Tensor\r\n> ```\r\n> \r\n> Any idea to resolve this @sshleifer\r\n\r\nWhich file are you editing?" ]
1,589
1,648
1,589
NONE
null
# ❓ Questions & Help <!-- The GitHub issue tracker is primarly intended for bugs, feature requests, new models and benchmarks, and migration questions. For all other questions, we direct you to Stack Overflow (SO) where a whole community of PyTorch and Tensorflow enthusiast can help you out. Make sure to tag your question with the right deep learning framework as well as the huggingface-transformers tag: https://stackoverflow.com/questions/tagged/huggingface-transformers If your question wasn't answered after a period of time on Stack Overflow, you can always open a question on GitHub. You should then link to the SO question that you posted. --> ## Details <!-- Description of your issue --> Fairseq folks say we can finetune BART model with longer seq_len on our custom training data. They pre-trained bart on 512 seq_len and during fine-tuning, they use 1024 seq_len. One can raise it further (let's say 2048) and finetune. For above, we would need to adjust positional embeddings by either: 1. learning them from start. 2. copy 512 from pre-trained BART to the first 512 of your 2048 positional embedding. with 2 being recommended. If I have to do it any pointers where to change the code ? https://github.com/pytorch/fairseq/issues/1685
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4277/reactions", "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4277/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4276
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4276/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4276/comments
https://api.github.com/repos/huggingface/transformers/issues/4276/events
https://github.com/huggingface/transformers/pull/4276
615,636,419
MDExOlB1bGxSZXF1ZXN0NDE1OTA1MjQ0
4,276
Update README.md
{ "login": "savasy", "id": 6584825, "node_id": "MDQ6VXNlcjY1ODQ4MjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6584825?v=4", "gravatar_id": "", "url": "https://api.github.com/users/savasy", "html_url": "https://github.com/savasy", "followers_url": "https://api.github.com/users/savasy/followers", "following_url": "https://api.github.com/users/savasy/following{/other_user}", "gists_url": "https://api.github.com/users/savasy/gists{/gist_id}", "starred_url": "https://api.github.com/users/savasy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/savasy/subscriptions", "organizations_url": "https://api.github.com/users/savasy/orgs", "repos_url": "https://api.github.com/users/savasy/repos", "events_url": "https://api.github.com/users/savasy/events{/privacy}", "received_events_url": "https://api.github.com/users/savasy/received_events", "type": "User", "site_admin": false }
[ { "id": 1838412367, "node_id": "MDU6TGFiZWwxODM4NDEyMzY3", "url": "https://api.github.com/repos/huggingface/transformers/labels/model%20card", "name": "model card", "color": "92d5f4", "default": false, "description": "Related to pretrained model cards" } ]
closed
false
null
[]
[]
1,589
1,589
1,589
CONTRIBUTOR
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4276/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4276/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4276", "html_url": "https://github.com/huggingface/transformers/pull/4276", "diff_url": "https://github.com/huggingface/transformers/pull/4276.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4276.patch", "merged_at": 1589210681000 }
https://api.github.com/repos/huggingface/transformers/issues/4275
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4275/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4275/comments
https://api.github.com/repos/huggingface/transformers/issues/4275/events
https://github.com/huggingface/transformers/issues/4275
615,579,698
MDU6SXNzdWU2MTU1Nzk2OTg=
4,275
training script for any tensorflow based pre-trained model for question-answer
{ "login": "Akashdesarda", "id": 26931751, "node_id": "MDQ6VXNlcjI2OTMxNzUx", "avatar_url": "https://avatars.githubusercontent.com/u/26931751?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Akashdesarda", "html_url": "https://github.com/Akashdesarda", "followers_url": "https://api.github.com/users/Akashdesarda/followers", "following_url": "https://api.github.com/users/Akashdesarda/following{/other_user}", "gists_url": "https://api.github.com/users/Akashdesarda/gists{/gist_id}", "starred_url": "https://api.github.com/users/Akashdesarda/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Akashdesarda/subscriptions", "organizations_url": "https://api.github.com/users/Akashdesarda/orgs", "repos_url": "https://api.github.com/users/Akashdesarda/repos", "events_url": "https://api.github.com/users/Akashdesarda/events{/privacy}", "received_events_url": "https://api.github.com/users/Akashdesarda/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,594
1,594
NONE
null
# ❓ Questions & Help <!-- The GitHub issue tracker is primarly intended for bugs, feature requests, new models and benchmarks, and migration questions. For all other questions, we direct you to Stack Overflow (SO) where a whole community of PyTorch and Tensorflow enthusiast can help you out. Make sure to tag your question with the right deep learning framework as well as the huggingface-transformers tag: https://stackoverflow.com/questions/tagged/huggingface-transformers If your question wasn't answered after a period of time on Stack Overflow, you can always open a question on GitHub. You should then link to the SO question that you posted. --> I am trying to train a question-answer model from scratch using TensorFlow backend. But I am getting unexpected result. It would be a great help if Hugging Face team or anyone can share training script of any TensorFlow based pre-trained model for question-answer (like 'bert-large-uncased-whole-word-masking-finetuned-squad' or 'distilbert-base-uncased-distilled-squad', etc) <!-- You should first ask your question on SO, and only if you didn't get an answer ask it here on GitHub. --> **A link to original question on Stack Overflow**: https://stackoverflow.com/questions/61708227/how-to-train-any-hugging-face-transformer-model-eg-distilbert-for-question-ans
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4275/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4275/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4274
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4274/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4274/comments
https://api.github.com/repos/huggingface/transformers/issues/4274/events
https://github.com/huggingface/transformers/issues/4274
615,567,611
MDU6SXNzdWU2MTU1Njc2MTE=
4,274
Wrong returns of API:get_special_tokens_mask()
{ "login": "ishikawa-takumi", "id": 16411341, "node_id": "MDQ6VXNlcjE2NDExMzQx", "avatar_url": "https://avatars.githubusercontent.com/u/16411341?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ishikawa-takumi", "html_url": "https://github.com/ishikawa-takumi", "followers_url": "https://api.github.com/users/ishikawa-takumi/followers", "following_url": "https://api.github.com/users/ishikawa-takumi/following{/other_user}", "gists_url": "https://api.github.com/users/ishikawa-takumi/gists{/gist_id}", "starred_url": "https://api.github.com/users/ishikawa-takumi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ishikawa-takumi/subscriptions", "organizations_url": "https://api.github.com/users/ishikawa-takumi/orgs", "repos_url": "https://api.github.com/users/ishikawa-takumi/repos", "events_url": "https://api.github.com/users/ishikawa-takumi/events{/privacy}", "received_events_url": "https://api.github.com/users/ishikawa-takumi/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "Yes, this is https://github.com/huggingface/transformers/issues/1784 come again, the issue is in the doc, not in the code", "Indeed, thanks for raising this issue." ]
1,589
1,589
1,589
NONE
null
# 🐛 Bug ## Information Model I am using (Bert, XLNet ...): Roberta Language I am using the model on (English, Chinese ...): English The problem arises when using: * [ ] the official example scripts: (give details below) * [x ] my own modified scripts: (give details below) I use transformers tokenizer, and created mask using API: get_special_tokens_mask. [My Code](https://github.com/ishikawa-takumi/transformers-sample/blob/master/tokenizer.ipynb) In [RoBERTa Doc](https://huggingface.co/transformers/model_doc/roberta.html), returns of this API is "A list of integers in the range [0, 1]: 0 for a special token, 1 for a sequence token". But I seem that this API returns "0 for a sequence token, 1 for a special token". ## To reproduce Steps to reproduce the behavior: 1. Use get_special_tokens_mask(). 2. 3. <!-- If you have code snippets, error messages, stack traces please provide them here as well. Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.--> ## Expected behavior <!-- A clear and concise description of what you would expect to happen. --> Returns of this API is "A list of integers in the range [0, 1]: 0 for a special token, 1 for a sequence token". ## Environment info <!-- You can run the command `transformers-cli env` and copy-and-paste its output below. Don't forget to fill out the missing fields in that output! --> - `transformers` version: - Platform: - Python version: - PyTorch version (GPU?): - Tensorflow version (GPU?): - Using GPU in script?: - Using distributed or parallel set-up in script?:
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4274/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4274/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4273
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4273/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4273/comments
https://api.github.com/repos/huggingface/transformers/issues/4273/events
https://github.com/huggingface/transformers/pull/4273
615,517,195
MDExOlB1bGxSZXF1ZXN0NDE1ODExMjgw
4,273
Add migrating from `pytorch-transformers`
{ "login": "guoquan", "id": 1118270, "node_id": "MDQ6VXNlcjExMTgyNzA=", "avatar_url": "https://avatars.githubusercontent.com/u/1118270?v=4", "gravatar_id": "", "url": "https://api.github.com/users/guoquan", "html_url": "https://github.com/guoquan", "followers_url": "https://api.github.com/users/guoquan/followers", "following_url": "https://api.github.com/users/guoquan/following{/other_user}", "gists_url": "https://api.github.com/users/guoquan/gists{/gist_id}", "starred_url": "https://api.github.com/users/guoquan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/guoquan/subscriptions", "organizations_url": "https://api.github.com/users/guoquan/orgs", "repos_url": "https://api.github.com/users/guoquan/repos", "events_url": "https://api.github.com/users/guoquan/events{/privacy}", "received_events_url": "https://api.github.com/users/guoquan/received_events", "type": "User", "site_admin": false }
[ { "id": 1834067346, "node_id": "MDU6TGFiZWwxODM0MDY3MzQ2", "url": "https://api.github.com/repos/huggingface/transformers/labels/Documentation", "name": "Documentation", "color": "77cc3b", "default": false, "description": "" }, { "id": 1897896961, "node_id": "MDU6TGFiZWwxODk3ODk2OTYx", "url": "https://api.github.com/repos/huggingface/transformers/labels/Migration", "name": "Migration", "color": "e99695", "default": false, "description": "" } ]
closed
false
null
[]
[ "LGTM" ]
1,589
1,589
1,589
CONTRIBUTOR
null
"Migrating from pytorch-transformers to transformers" is missing in the main document. It is available in the main `readme` thought. Just move it to the document.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4273/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4273/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4273", "html_url": "https://github.com/huggingface/transformers/pull/4273", "diff_url": "https://github.com/huggingface/transformers/pull/4273.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4273.patch", "merged_at": 1589218514000 }
https://api.github.com/repos/huggingface/transformers/issues/4272
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4272/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4272/comments
https://api.github.com/repos/huggingface/transformers/issues/4272/events
https://github.com/huggingface/transformers/issues/4272
615,511,571
MDU6SXNzdWU2MTU1MTE1NzE=
4,272
FileNotFoundError when running distributed Trainer
{ "login": "shaoyent", "id": 8154586, "node_id": "MDQ6VXNlcjgxNTQ1ODY=", "avatar_url": "https://avatars.githubusercontent.com/u/8154586?v=4", "gravatar_id": "", "url": "https://api.github.com/users/shaoyent", "html_url": "https://github.com/shaoyent", "followers_url": "https://api.github.com/users/shaoyent/followers", "following_url": "https://api.github.com/users/shaoyent/following{/other_user}", "gists_url": "https://api.github.com/users/shaoyent/gists{/gist_id}", "starred_url": "https://api.github.com/users/shaoyent/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/shaoyent/subscriptions", "organizations_url": "https://api.github.com/users/shaoyent/orgs", "repos_url": "https://api.github.com/users/shaoyent/repos", "events_url": "https://api.github.com/users/shaoyent/events{/privacy}", "received_events_url": "https://api.github.com/users/shaoyent/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "Yes, I think you're right. Relaunching training from a checkpoint would however require the user to copy the weights to other machines, right?", "> Yes, I think you're right. Relaunching training from a checkpoint would however require the user to copy the weights to other machines, right?\r\n\r\nYes, loading from checkpoint can be done on all nodes.\r\n", "So I think we should save checkpoints and final models on each **local master**.\r\n\r\nDo you agree?", "Would there be a difference in checkpoints between each local master ?\r\nIf they're identical I'd think it be best to reduce write overhead and save only once (i.e world master)", "No difference, but the issue is that you won't be able to restart training from a checkpoint (unless you copy it around) if we only save to world master", "Ah, I see, thanks for the clarification. \r\nI'm assuming a shared file system so it's all saving and loading from the same file. \r\nI guess for other cluster configurations that makes sense, but care would have to be taken to avoid write/mkdir conflicts from multiple processes.", "I see. Thinking about it more, yes, I think it like it if we only save from world_master. (even if it adds one step for some users). Thanks for your insight." ]
1,589
1,589
1,589
CONTRIBUTOR
null
# 🐛 Bug ## Information I'm running the language modeling example in distributed mode and am getting FileNotFoundError in the Trainer. The error : ``` Traceback (most recent call last): File "run_language_modeling.py", line 292, in <module> main() File "run_language_modeling.py", line 257, in main trainer.train(model_path=model_path) File "/home/shaoyent/anaconda3/envs/bert/lib/python3.7/site-packages/transformers/trainer.py", line 451, in train torch.save(optimizer.state_dict(), os.path.join(output_dir, "optimizer.pt")) File "/home/shaoyent/anaconda3/envs/bert/lib/python3.7/site-packages/torch/serialization.py", line 327, in save with _open_file_like(f, 'wb') as opened_file: File "/home/shaoyent/anaconda3/envs/bert/lib/python3.7/site-packages/torch/serialization.py", line 212, in _open_file_like return _open_file(name_or_buffer, mode) File "/home/shaoyent/anaconda3/envs/bert/lib/python3.7/site-packages/torch/serialization.py", line 193, in __init__ super(_open_file, self).__init__(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: '/home/shaoyent/transformers/examples/language-modeling/output/checkpoint-500/optimizer.pt' ``` The error seems to be the Trainer saving checkpoints in each [local master](https://github.com/huggingface/transformers/blob/b290c32e1617fa74f44ccd8b83365fe764437be9/src/transformers/trainer.py#L413) while the directory is created by [world master](https://github.com/huggingface/transformers/blob/b290c32e1617fa74f44ccd8b83365fe764437be9/src/transformers/trainer.py#L448) causing a race condition. I think the suggested method is to handle save checkpoints in world master, since weights should be synchronized after backprop.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4272/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4272/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4271
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4271/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4271/comments
https://api.github.com/repos/huggingface/transformers/issues/4271/events
https://github.com/huggingface/transformers/issues/4271
615,477,229
MDU6SXNzdWU2MTU0NzcyMjk=
4,271
Evaluating a checkpoint
{ "login": "jmamou", "id": 19263306, "node_id": "MDQ6VXNlcjE5MjYzMzA2", "avatar_url": "https://avatars.githubusercontent.com/u/19263306?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jmamou", "html_url": "https://github.com/jmamou", "followers_url": "https://api.github.com/users/jmamou/followers", "following_url": "https://api.github.com/users/jmamou/following{/other_user}", "gists_url": "https://api.github.com/users/jmamou/gists{/gist_id}", "starred_url": "https://api.github.com/users/jmamou/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jmamou/subscriptions", "organizations_url": "https://api.github.com/users/jmamou/orgs", "repos_url": "https://api.github.com/users/jmamou/repos", "events_url": "https://api.github.com/users/jmamou/events{/privacy}", "received_events_url": "https://api.github.com/users/jmamou/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "Yes: you need to use the path to the saved model as the `--model_name_or_path` argument.\r\n\r\n`--model_name_or_path` is the argument that conditions which model is loaded.\r\n\r\nWill close this for now." ]
1,589
1,589
1,589
CONTRIBUTOR
null
# ❓ Questions & Help <!-- The GitHub issue tracker is primarly intended for bugs, feature requests, new models and benchmarks, and migration questions. For all other questions, we direct you to Stack Overflow (SO) where a whole community of PyTorch and Tensorflow enthusiast can help you out. Make sure to tag your question with the right deep learning framework as well as the huggingface-transformers tag: https://stackoverflow.com/questions/tagged/huggingface-transformers If your question wasn't answered after a period of time on Stack Overflow, you can always open a question on GitHub. You should then link to the SO question that you posted. --> ## Details <!-- Description of your issue --> I have trained a NER model with the following command python3.6 examples/token-classification/run_ner.py --save_steps 100 --data_dir $DIR --model_type bert --model_name_or_path bert-base-cased --output_dir $DIR/model --do_train --do_eval --do_predict --overwrite_output_dir --labels $DIR/labels.txt --evaluate_during_training --max_seq_length 300 Now, I am trying to evaluate and predict at checkpoint 500 (already evaluated during training using --evaluate_during_training argument) using the following command python3.6 examples/token-classification/run_ner.py --data_dir $DIR --model_type bert --model_name_or_path bert-base-cased --output_dir $DIR/model/checkpoint-500 --do_eval --do_predict --labels $DIR/labels.txt --max_seq_length 300 However, I don't get same performance as during training (as evaluated at the same checkpoint using --evaluate_during_training argument), I get lower performance (by far). Any idea about it? <!-- You should first ask your question on SO, and only if you didn't get an answer ask it here on GitHub. --> **A link to original question on Stack Overflow**:
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4271/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4271/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4270
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4270/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4270/comments
https://api.github.com/repos/huggingface/transformers/issues/4270/events
https://github.com/huggingface/transformers/pull/4270
615,474,770
MDExOlB1bGxSZXF1ZXN0NDE1Nzc5NzA3
4,270
Add MultipleChoice to TFTrainer [WIP]
{ "login": "ViktorAlm", "id": 1090762, "node_id": "MDQ6VXNlcjEwOTA3NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/1090762?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ViktorAlm", "html_url": "https://github.com/ViktorAlm", "followers_url": "https://api.github.com/users/ViktorAlm/followers", "following_url": "https://api.github.com/users/ViktorAlm/following{/other_user}", "gists_url": "https://api.github.com/users/ViktorAlm/gists{/gist_id}", "starred_url": "https://api.github.com/users/ViktorAlm/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ViktorAlm/subscriptions", "organizations_url": "https://api.github.com/users/ViktorAlm/orgs", "repos_url": "https://api.github.com/users/ViktorAlm/repos", "events_url": "https://api.github.com/users/ViktorAlm/events{/privacy}", "received_events_url": "https://api.github.com/users/ViktorAlm/received_events", "type": "User", "site_admin": false }
[ { "id": 1834054694, "node_id": "MDU6TGFiZWwxODM0MDU0Njk0", "url": "https://api.github.com/repos/huggingface/transformers/labels/TensorFlow", "name": "TensorFlow", "color": "FF6F00", "default": false, "description": "Anything TensorFlow" }, { "id": 1834066408, "node_id": "MDU6TGFiZWwxODM0MDY2NDA4", "url": "https://api.github.com/repos/huggingface/transformers/labels/Ex:%20Multiple%20Choice", "name": "Ex: Multiple Choice", "color": "B6FFF8", "default": false, "description": "" } ]
closed
false
null
[]
[ "Hey! \r\n\r\nThanks a lot for your contribution on the trainer :+1:\r\n\r\nYour PR looks great! Just have a small comment, see above. Don't hesitate if you have questions!", "#4252 \r\n\r\n```\r\n05/11/2020 19:59:05 - INFO - oauth2client.transport - Attempting refresh to obtain initial access_token\r\nINFO:tensorflow:Found TPU system:\r\n05/11/2020 19:59:05 - INFO - tensorflow - Found TPU system:\r\nINFO:tensorflow:*** Num TPU Cores: 8\r\n05/11/2020 19:59:05 - INFO - tensorflow - *** Num TPU Cores: 8\r\nINFO:tensorflow:*** Num TPU Workers: 1\r\n05/11/2020 19:59:05 - INFO - tensorflow - *** Num TPU Workers: 1\r\nINFO:tensorflow:*** Num TPU Cores Per Worker: 8\r\n05/11/2020 19:59:05 - INFO - tensorflow - *** Num TPU Cores Per Worker: 8\r\n```\r\nSo its grabbing by name now by specifying --tpu_name", "How do I see what fails with the code quality in __init__.py? I do run make style hehe\r\n\r\nGreat work with the trainer @jplu I saw your other plans for it. Would be very neat.\r\n\r\nIll mess around with the TFdataset and tpus on another branch, i need to read up on some stuff. Is there anywhere i can see the plans for a framework agnostic approach for the datasets?", "Thanks :)\r\n\r\nFor the style I always do it manually in this following order:\r\n\r\n```\r\nisort --recursive examples templates tests src utils\r\nblack --line-length 119 --target-version py35 examples templates tests src utils\r\nflake8 examples templates tests src utils\r\n```\r\nThen git add/commit/push.\r\n\r\nWhat is currently working in your MPC example? Single GPU and CPU?", "> Thanks :)\r\n> \r\n> For the style I always do it manually in this following order:\r\n> \r\n> ```\r\n> isort --recursive examples templates tests src utils\r\n> black --line-length 119 --target-version py35 examples templates tests src utils\r\n> flake8 examples templates tests src utils\r\n> ```\r\n> \r\n> Then git add/commit/push.\r\n> \r\n> What is currently working in your MPC example? Single GPU and CPU?\r\n\r\nYep only tested on my trusty rtx2080 and in colab on gpu.", "Very Good!\r\n\r\nYou should also update the examples [README](https://github.com/huggingface/transformers/blob/master/examples/README.md) to add the check to the multiple_choice TFTrainer support :wink: ", "Can you also add a TF section in the multiple_choice [README](https://github.com/huggingface/transformers/tree/master/examples/multiple-choice) plz", "> Can you also add a TF section in the multiple_choice [README](https://github.com/huggingface/transformers/tree/master/examples/multiple-choice) plz\r\n\r\nI should sleep on this. Thanks alot for the help!", "Looks very good! Let me know once you think it can be merged.", "@ViktorAlm I think it's great if you link to your Colab! Maybe just save it to a repo so that one can take a look at the history (and open issues if it ever breaks:)", "None of the failing flake8 code quality seems to be related to me. If this works I think its done for now.", "Looks good to me!\r\n\r\n@julien-c and @LysandreJik should double check and merge if it seems good for them.", "Maybe add a link to the syn dataset you added. It's [that one](https://aclweb.org/aclwiki/TOEFL_Synonym_Questions_(State_of_the_art)) right?", "In the Colab ideally we would expose/expand a little bit more what happens in the example scripts (see what we did in the Colab for GLUE for instance), i.e. the calls to Trainer/TFTrainer.\r\n\r\nWe can improve/expand this in the future though @ViktorAlm @jplu ", "> Maybe add a link to the syn dataset you added. It's [that one](https://aclweb.org/aclwiki/TOEFL_Synonym_Questions_(State_of_the_art)) right?\r\n\r\nIts my own dataset which ill release once I'm done" ]
1,589
1,589
1,589
CONTRIBUTOR
null
Working on getting the TF trainer running on TPUs for multiple choice. I'm quite the newb so input is needed. - [x] Add 1 GPU strategy - [x] Args for TPU Name - [x] Add MPC example for TFTrainer - [x] Fix docstrings Examples: GPU on Swag https://colab.research.google.com/drive/1X9d1TY1I7r8d3rCJ9vWiy0UgvJM6BqQ4 TPU on Swag (fails, havent looked into it might be my misstake): https://colab.research.google.com/drive/1X9d1TY1I7r8d3rCJ9vWiy0UgvJM6BqQ4#scrollTo=2r1Rng8NWzit Glue on TPU (fails, havent looked into it, might be my mistake) https://colab.research.google.com/drive/1f2x5wPSaBV0NbGCpMyUPXGUSMEGjSHeX#scrollTo=YDhXmegN3WWj
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4270/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4270/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4270", "html_url": "https://github.com/huggingface/transformers/pull/4270", "diff_url": "https://github.com/huggingface/transformers/pull/4270.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4270.patch", "merged_at": 1589287729000 }
https://api.github.com/repos/huggingface/transformers/issues/4269
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4269/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4269/comments
https://api.github.com/repos/huggingface/transformers/issues/4269/events
https://github.com/huggingface/transformers/pull/4269
615,470,891
MDExOlB1bGxSZXF1ZXN0NDE1Nzc2OTc5
4,269
[Jax] top_k_top_p
{ "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,589
1,590
1,590
MEMBER
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4269/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4269/timeline
null
true
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4269", "html_url": "https://github.com/huggingface/transformers/pull/4269", "diff_url": "https://github.com/huggingface/transformers/pull/4269.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4269.patch", "merged_at": null }
https://api.github.com/repos/huggingface/transformers/issues/4268
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4268/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4268/comments
https://api.github.com/repos/huggingface/transformers/issues/4268/events
https://github.com/huggingface/transformers/issues/4268
615,460,537
MDU6SXNzdWU2MTU0NjA1Mzc=
4,268
KlDivBackward
{ "login": "alshahrani2030", "id": 55197626, "node_id": "MDQ6VXNlcjU1MTk3NjI2", "avatar_url": "https://avatars.githubusercontent.com/u/55197626?v=4", "gravatar_id": "", "url": "https://api.github.com/users/alshahrani2030", "html_url": "https://github.com/alshahrani2030", "followers_url": "https://api.github.com/users/alshahrani2030/followers", "following_url": "https://api.github.com/users/alshahrani2030/following{/other_user}", "gists_url": "https://api.github.com/users/alshahrani2030/gists{/gist_id}", "starred_url": "https://api.github.com/users/alshahrani2030/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/alshahrani2030/subscriptions", "organizations_url": "https://api.github.com/users/alshahrani2030/orgs", "repos_url": "https://api.github.com/users/alshahrani2030/repos", "events_url": "https://api.github.com/users/alshahrani2030/events{/privacy}", "received_events_url": "https://api.github.com/users/alshahrani2030/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,594
1,594
NONE
null
Hi, I fine-tune bert and using KLDivLoss instead of CrossEntropyLoss in binary classification. when I call loss.backward() I got this error !? ![error-KLDiv](https://user-images.githubusercontent.com/55197626/81508647-4dd85780-92d3-11ea-9547-a9690b733a61.PNG) Thank you in advance
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4268/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4268/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4267
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4267/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4267/comments
https://api.github.com/repos/huggingface/transformers/issues/4267/events
https://github.com/huggingface/transformers/pull/4267
615,443,765
MDExOlB1bGxSZXF1ZXN0NDE1NzU3NTgx
4,267
useless chg
{ "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,589
1,589
1,589
CONTRIBUTOR
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4267/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4267/timeline
null
true
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4267", "html_url": "https://github.com/huggingface/transformers/pull/4267", "diff_url": "https://github.com/huggingface/transformers/pull/4267.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4267.patch", "merged_at": null }
https://api.github.com/repos/huggingface/transformers/issues/4266
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4266/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4266/comments
https://api.github.com/repos/huggingface/transformers/issues/4266/events
https://github.com/huggingface/transformers/pull/4266
615,443,223
MDExOlB1bGxSZXF1ZXN0NDE1NzU3MTk1
4,266
[CI] remove run_tests_torch_and_tf
{ "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "(fixed git history locally for future PRs)", "# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4266?src=pr&el=h1) Report\n> Merging [#4266](https://codecov.io/gh/huggingface/transformers/pull/4266?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/3487be75ef8f0d51c51208f266644fc04a947085&el=desc) will **decrease** coverage by `0.84%`.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4266/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4266?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4266 +/- ##\n==========================================\n- Coverage 78.39% 77.55% -0.85% \n==========================================\n Files 120 120 \n Lines 19932 19932 \n==========================================\n- Hits 15626 15458 -168 \n- Misses 4306 4474 +168 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4266?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [src/transformers/modeling\\_tf\\_pytorch\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4266/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9weXRvcmNoX3V0aWxzLnB5) | `8.72% <0.00%> (-81.21%)` | :arrow_down: |\n| [src/transformers/modeling\\_roberta.py](https://codecov.io/gh/huggingface/transformers/pull/4266/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19yb2JlcnRhLnB5) | `85.71% <0.00%> (-10.00%)` | :arrow_down: |\n| [src/transformers/modeling\\_ctrl.py](https://codecov.io/gh/huggingface/transformers/pull/4266/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19jdHJsLnB5) | `95.19% <0.00%> (-2.63%)` | :arrow_down: |\n| [src/transformers/modeling\\_xlnet.py](https://codecov.io/gh/huggingface/transformers/pull/4266/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ194bG5ldC5weQ==) | `73.44% <0.00%> (-2.30%)` | :arrow_down: |\n| [src/transformers/modeling\\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/4266/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19vcGVuYWkucHk=) | `80.41% <0.00%> (-1.38%)` | :arrow_down: |\n| [src/transformers/trainer.py](https://codecov.io/gh/huggingface/transformers/pull/4266/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmVyLnB5) | `40.51% <0.00%> (-0.58%)` | :arrow_down: |\n| [src/transformers/modeling\\_tf\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4266/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `92.93% <0.00%> (ø)` | |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4266?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4266?src=pr&el=footer). Last update [3487be7...4aab0f5](https://codecov.io/gh/huggingface/transformers/pull/4266?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "I found two common tests that require both packages:\r\n```\r\ntest_batch_encode_plus_tensors\r\ntest_pt_tf_model_equivalence\r\n```\r\nSo I run test_pt_tf_model_equivalence for all test_modeling_tf* files, and\r\ntest_batch_encode_plus_tensors for all files. \r\nStill saves quite a bit of time.\r\n", "Kinda reluctant to do this change because then we need to manually maintain over time a whitelist of tests, which complicates the (already convoluted) CI setup. I'm also worried we might miss some side-effects of having both frameworks installed.\r\n\r\nWhat time do those tests take?", "6 mins / 13 mins, at least once per PR.\r\nI think it's a good tradeoff.\r\n- we are losing 0 coverage.\r\n- people rarely add new tests that check equivalence of torch and tf. We would rarely need to update the whitelist.\r\n- For most bugs, we would all be able to reproduce it locally where we have both frameworks installed.\r\n\r\nDon't feel too strongly, of course.\r\n- Also happy to move the old job to less often then every push.", "What does 6 mins / 13 mins mean?", "Before this change `run_test_torch_and_tf` takes 6 mins, and the whole CircleCI suite takes 13mins.", "How do you measure the whole CircleCI suite, given that the tests are (AFAIK) parallelized?", "By looking at circleci output like [this](https://app.circleci.com/pipelines/github/huggingface/transformers/5174/workflows/3aecb0e9-14f0-4762-ad6a-73b60db2d626) and guessing\r\n", "[This](https://app.circleci.com/pipelines/github/huggingface/transformers/6581/workflows/b114b306-2553-42cf-bb67-ba507e051929) is after pipelines improvements, so I may be overestimating the benefit of the change. Although it seems ridiculous that `check_code_quality` took 3 mins.", "@julien-c seems like we don't want to do this? Happy to abandon." ]
1,589
1,597
1,597
CONTRIBUTOR
null
Problem: This job is rerunning all tests, after `run_tests_torch` and `run_tests_tf` with both packages installed. Meaning that it ~doubles the runtime of CI and doesn't find very many bugs. Solution: This changes `run_tests_torch_and_tf` to only run the tests that require both TF and torch
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4266/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4266/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4266", "html_url": "https://github.com/huggingface/transformers/pull/4266", "diff_url": "https://github.com/huggingface/transformers/pull/4266.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4266.patch", "merged_at": null }
https://api.github.com/repos/huggingface/transformers/issues/4265
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4265/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4265/comments
https://api.github.com/repos/huggingface/transformers/issues/4265/events
https://github.com/huggingface/transformers/issues/4265
615,442,286
MDU6SXNzdWU2MTU0NDIyODY=
4,265
[DOCS] BertModel documentation doesn't mention the usage of tokenizers for creating input_ids
{ "login": "Sriharsha-hatwar", "id": 14826535, "node_id": "MDQ6VXNlcjE0ODI2NTM1", "avatar_url": "https://avatars.githubusercontent.com/u/14826535?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Sriharsha-hatwar", "html_url": "https://github.com/Sriharsha-hatwar", "followers_url": "https://api.github.com/users/Sriharsha-hatwar/followers", "following_url": "https://api.github.com/users/Sriharsha-hatwar/following{/other_user}", "gists_url": "https://api.github.com/users/Sriharsha-hatwar/gists{/gist_id}", "starred_url": "https://api.github.com/users/Sriharsha-hatwar/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Sriharsha-hatwar/subscriptions", "organizations_url": "https://api.github.com/users/Sriharsha-hatwar/orgs", "repos_url": "https://api.github.com/users/Sriharsha-hatwar/repos", "events_url": "https://api.github.com/users/Sriharsha-hatwar/events{/privacy}", "received_events_url": "https://api.github.com/users/Sriharsha-hatwar/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,595
1,595
NONE
null
Documentation of https://huggingface.co/transformers/model_doc/bert.html#transformers.BertModel.forward currently doesn't mention the usage of `tokenizers.BertWordPieceTokenizer` for instance when I am using BertModel.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4265/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4265/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4264
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4264/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4264/comments
https://api.github.com/repos/huggingface/transformers/issues/4264/events
https://github.com/huggingface/transformers/pull/4264
615,437,018
MDExOlB1bGxSZXF1ZXN0NDE1NzUyNjQ4
4,264
Align sentiment-analysis' tokenizer (currently cased) to the model (uncased)
{ "login": "mfuntowicz", "id": 2241520, "node_id": "MDQ6VXNlcjIyNDE1MjA=", "avatar_url": "https://avatars.githubusercontent.com/u/2241520?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mfuntowicz", "html_url": "https://github.com/mfuntowicz", "followers_url": "https://api.github.com/users/mfuntowicz/followers", "following_url": "https://api.github.com/users/mfuntowicz/following{/other_user}", "gists_url": "https://api.github.com/users/mfuntowicz/gists{/gist_id}", "starred_url": "https://api.github.com/users/mfuntowicz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mfuntowicz/subscriptions", "organizations_url": "https://api.github.com/users/mfuntowicz/orgs", "repos_url": "https://api.github.com/users/mfuntowicz/repos", "events_url": "https://api.github.com/users/mfuntowicz/events{/privacy}", "received_events_url": "https://api.github.com/users/mfuntowicz/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "LGTM, or even better we could duplicate those tokenizer files into `distilbert-base-uncased-finetuned-sst-2-english` as now we kind of assume that a model == model + tokenizer.", "Merging this for now and can update to @julien-c's proposal in a future PR", "Yeah, just wanted to ping @mfuntowicz on this model/tokenizer subject ", "Hi guys, I pulled from master after the merge of the PR but the behaviour is still the same. It doesn't look like aligning the tokenizer resolved this issue." ]
1,589
1,589
1,589
MEMBER
null
`sentiment-analysis` pipeline has a tokenizer using a cased vocab while the model is uncased. This PR makes the tokenizer uncased to match the actual model's vocab.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4264/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4264/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4264", "html_url": "https://github.com/huggingface/transformers/pull/4264", "diff_url": "https://github.com/huggingface/transformers/pull/4264.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4264.patch", "merged_at": 1589215553000 }
https://api.github.com/repos/huggingface/transformers/issues/4263
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4263/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4263/comments
https://api.github.com/repos/huggingface/transformers/issues/4263/events
https://github.com/huggingface/transformers/issues/4263
615,365,353
MDU6SXNzdWU2MTUzNjUzNTM=
4,263
Sentiment Analysis Pipeline is predicting incorrect sentiment in 2.9
{ "login": "mabu-dev", "id": 22409996, "node_id": "MDQ6VXNlcjIyNDA5OTk2", "avatar_url": "https://avatars.githubusercontent.com/u/22409996?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mabu-dev", "html_url": "https://github.com/mabu-dev", "followers_url": "https://api.github.com/users/mabu-dev/followers", "following_url": "https://api.github.com/users/mabu-dev/following{/other_user}", "gists_url": "https://api.github.com/users/mabu-dev/gists{/gist_id}", "starred_url": "https://api.github.com/users/mabu-dev/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mabu-dev/subscriptions", "organizations_url": "https://api.github.com/users/mabu-dev/orgs", "repos_url": "https://api.github.com/users/mabu-dev/repos", "events_url": "https://api.github.com/users/mabu-dev/events{/privacy}", "received_events_url": "https://api.github.com/users/mabu-dev/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "This PR should fix the problem:\r\nhttps://github.com/huggingface/transformers/pull/4264\r\n\r\nA mismatched tokenizer is hooked up with the pipeline.", "yes, you are right. \r\n\r\nI also tested all sentences both positive and negative. But it is showing NEGATIVE all the time.", "> This PR should fix the problem:\r\n> #4264\r\n> \r\n> A mismatched tokenizer is hooked up with the pipeline.\r\n\r\nThis PR didn't resolve the issue. I pulled from master but behaviour still the same. Have you tested?", "Yes, I'm always getting NEGATIVE class regardless of the text", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n", "Same issue...incorrect sentiment for \"nlp(\"i hate you\")\" shows [{'label': 'POSITIVE', 'score': 0.536677360534668}]", "in 3.1, I always get label=\"POSITIVE\". Must be a bug somewhere", "I get Positive label with high score(0.99) for neutral statements like \"This is just a statement\" or \"My name is this\".\r\nI don't know whats wrong. I used the base example.\r\nfrom transformers import pipeline\r\nsentiment_model = pipeline('sentiment-analysis')\r\nsentiment_model('This is just a statement.')" ]
1,589
1,606
1,595
NONE
null
# 🐛 Bug Sentiment Analysis Pipeline is predicting incorrect sentiment. Everything seems to be NEGATIVE. ## To reproduce Steps to reproduce the behavior: Left a Colab Notebook here for reproducing: https://colab.research.google.com/drive/1hIwyBOGFpcLMUNmaKf5UYb0wPeYb4yKS?usp=sharing `pip install -qU transformers` `from transformers import pipeline` `sentiment_model29 = pipeline('sentiment-analysis')` `sentiment_model29('I hate this movie')` Returns: [{'label': 'NEGATIVE', 'score': 0.703369677066803}]
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4263/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4263/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4262
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4262/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4262/comments
https://api.github.com/repos/huggingface/transformers/issues/4262/events
https://github.com/huggingface/transformers/issues/4262
615,343,457
MDU6SXNzdWU2MTUzNDM0NTc=
4,262
NER Models not using BIO tagging scheme
{ "login": "guillaume-be", "id": 27071604, "node_id": "MDQ6VXNlcjI3MDcxNjA0", "avatar_url": "https://avatars.githubusercontent.com/u/27071604?v=4", "gravatar_id": "", "url": "https://api.github.com/users/guillaume-be", "html_url": "https://github.com/guillaume-be", "followers_url": "https://api.github.com/users/guillaume-be/followers", "following_url": "https://api.github.com/users/guillaume-be/following{/other_user}", "gists_url": "https://api.github.com/users/guillaume-be/gists{/gist_id}", "starred_url": "https://api.github.com/users/guillaume-be/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/guillaume-be/subscriptions", "organizations_url": "https://api.github.com/users/guillaume-be/orgs", "repos_url": "https://api.github.com/users/guillaume-be/repos", "events_url": "https://api.github.com/users/guillaume-be/events{/privacy}", "received_events_url": "https://api.github.com/users/guillaume-be/received_events", "type": "User", "site_admin": false }
[ { "id": 1834060867, "node_id": "MDU6TGFiZWwxODM0MDYwODY3", "url": "https://api.github.com/repos/huggingface/transformers/labels/Ex:%20Named%20Entity%20Recognition", "name": "Ex: Named Entity Recognition", "color": "06FFD8", "default": false, "description": "" } ]
closed
false
{ "login": "stefan-it", "id": 20651387, "node_id": "MDQ6VXNlcjIwNjUxMzg3", "avatar_url": "https://avatars.githubusercontent.com/u/20651387?v=4", "gravatar_id": "", "url": "https://api.github.com/users/stefan-it", "html_url": "https://github.com/stefan-it", "followers_url": "https://api.github.com/users/stefan-it/followers", "following_url": "https://api.github.com/users/stefan-it/following{/other_user}", "gists_url": "https://api.github.com/users/stefan-it/gists{/gist_id}", "starred_url": "https://api.github.com/users/stefan-it/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stefan-it/subscriptions", "organizations_url": "https://api.github.com/users/stefan-it/orgs", "repos_url": "https://api.github.com/users/stefan-it/repos", "events_url": "https://api.github.com/users/stefan-it/events{/privacy}", "received_events_url": "https://api.github.com/users/stefan-it/received_events", "type": "User", "site_admin": false }
[ { "login": "stefan-it", "id": 20651387, "node_id": "MDQ6VXNlcjIwNjUxMzg3", "avatar_url": "https://avatars.githubusercontent.com/u/20651387?v=4", "gravatar_id": "", "url": "https://api.github.com/users/stefan-it", "html_url": "https://github.com/stefan-it", "followers_url": "https://api.github.com/users/stefan-it/followers", "following_url": "https://api.github.com/users/stefan-it/following{/other_user}", "gists_url": "https://api.github.com/users/stefan-it/gists{/gist_id}", "starred_url": "https://api.github.com/users/stefan-it/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stefan-it/subscriptions", "organizations_url": "https://api.github.com/users/stefan-it/orgs", "repos_url": "https://api.github.com/users/stefan-it/repos", "events_url": "https://api.github.com/users/stefan-it/events{/privacy}", "received_events_url": "https://api.github.com/users/stefan-it/received_events", "type": "User", "site_admin": false } ]
[ "Hi @guillaume-be , only the CoNLL-2003 models are using this IOB1 tagging scheme, because it is used in the original dataset. You could convert it (+ needs proper testing) but this requires a modification of the original dataset.\r\n\r\nI could train models e.g. on the WikiANN corpus (see [here](https://www.aclweb.org/anthology/P17-1178/) and WikiANN with balanced train/dev/test splits [here](https://www.aclweb.org/anthology/P19-1015/)) for English, but this corpus is then just a \"silver standard\" :)", "Hi @stefan-it ,\r\n\r\nThank you for your response. Assuming the CoNLL-03 model is in IOB1 tagging scheme, it would still use `B-*` labels in case of multi-token entities. For example:\r\n```\r\nAlex I-PER\r\nis O\r\ngoing O\r\nto O\r\nLos B-LOC\r\nAngeles I-LOC\r\n```\r\nHowever, the model currently outputs the following for this example:\r\n```\r\nAlex I-PER\r\nis O\r\ngoing O\r\nto O\r\nLos I-LOC\r\nAngeles I-LOC\r\n```\r\n\r\nThis means that it is impossible to differentiate multi-token entities (such as Los Angeles) from multiple consecutive entities, e.g. `Alex Bob and Amy are going to Los Angeles`. So far I have never seen the model uploaded generate a `B-*` token. ", "`B-*` is only used when an entity follows right after another entity, e.g. different political parties, like this example from the training dataset:\r\n\r\n```bash\r\nMAY NNP I-NP O\r\n1996 CD I-NP O\r\nCDU NNP I-NP I-ORG\r\n/ SYM O I-ORG\r\nCSU NNP I-NP I-ORG\r\nSPD NNP I-NP B-ORG\r\nFDP NNP I-NP B-ORG\r\nGreens NNP I-NP B-ORG\r\nPDS NNP I-NP B-ORG\r\n```\r\n\r\nJust have a look at the last column. `CDU/CSU` can be considered as one entity, but right after it another political party `SPD` is followed, so it is tagged with a beginning `B-` :)", "@stefan-it thank you for the clarification!", "@stefan-it are there plans to [merge this pr](https://github.com/huggingface/transformers/pull/3957)? it could help with this issue. i have it myself as i need to pool entity embeddings. https://github.com/huggingface/transformers/issues/3548", "@petulla Should be merged soon 👍 " ]
1,589
1,589
1,589
CONTRIBUTOR
null
Hello, I have noticed that most (all?) pre-trained models uploaded seem not to use the BIO tagging scheme, instead returning `I-xxx` and `O` for all categories (`B-xxx` is not used). I believe this is just caused by the way these models have been trained. This makes using these models in actual pipelines difficult as entity parsing becomes impossible (two consecutive entities cannot be differentiated from a multi-tokens entity). Are there any plans for updating these models with a BIO labelling scheme? @stefan-it including you in the discussion as you have uploaded standard models used in the default pipelines
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4262/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4262/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4261
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4261/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4261/comments
https://api.github.com/repos/huggingface/transformers/issues/4261/events
https://github.com/huggingface/transformers/issues/4261
615,341,240
MDU6SXNzdWU2MTUzNDEyNDA=
4,261
I am training a bert model for question classification task, now it is a binary classifier. 0 for Descriptive question and 1 for not descriptive. While testing I am getting the following error :-
{ "login": "HarshMultani", "id": 24610919, "node_id": "MDQ6VXNlcjI0NjEwOTE5", "avatar_url": "https://avatars.githubusercontent.com/u/24610919?v=4", "gravatar_id": "", "url": "https://api.github.com/users/HarshMultani", "html_url": "https://github.com/HarshMultani", "followers_url": "https://api.github.com/users/HarshMultani/followers", "following_url": "https://api.github.com/users/HarshMultani/following{/other_user}", "gists_url": "https://api.github.com/users/HarshMultani/gists{/gist_id}", "starred_url": "https://api.github.com/users/HarshMultani/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/HarshMultani/subscriptions", "organizations_url": "https://api.github.com/users/HarshMultani/orgs", "repos_url": "https://api.github.com/users/HarshMultani/repos", "events_url": "https://api.github.com/users/HarshMultani/events{/privacy}", "received_events_url": "https://api.github.com/users/HarshMultani/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n", "use torch.unsqueeze(0) on b_input_ids,b_input_masks so that they become of shape (batch_size(=1),dim)", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,600
1,600
NONE
null
I have generated my model with the help of around 1700 questions But when I am testing it for one question at a time and running outputs = model(b_input_ids, token_type_ids=None, attention_mask=b_input_masks) It is giving me the following error ValueError: Wrong shape for input_ids (shape torch.Size([1])) or attention_mask (shape torch.Size([1])) b_input_ids are the padded id of the input question b_input_masks are the attention mask of the b_input_ids Any idea how this error can be resolved
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4261/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4261/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4260
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4260/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4260/comments
https://api.github.com/repos/huggingface/transformers/issues/4260/events
https://github.com/huggingface/transformers/issues/4260
615,322,870
MDU6SXNzdWU2MTUzMjI4NzA=
4,260
Strange Behaviour using Transformer pipline with FLASK
{ "login": "nimahm2020", "id": 65104405, "node_id": "MDQ6VXNlcjY1MTA0NDA1", "avatar_url": "https://avatars.githubusercontent.com/u/65104405?v=4", "gravatar_id": "", "url": "https://api.github.com/users/nimahm2020", "html_url": "https://github.com/nimahm2020", "followers_url": "https://api.github.com/users/nimahm2020/followers", "following_url": "https://api.github.com/users/nimahm2020/following{/other_user}", "gists_url": "https://api.github.com/users/nimahm2020/gists{/gist_id}", "starred_url": "https://api.github.com/users/nimahm2020/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nimahm2020/subscriptions", "organizations_url": "https://api.github.com/users/nimahm2020/orgs", "repos_url": "https://api.github.com/users/nimahm2020/repos", "events_url": "https://api.github.com/users/nimahm2020/events{/privacy}", "received_events_url": "https://api.github.com/users/nimahm2020/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "Hi @nimahm2020, \r\n\r\nThanks for reporting. \r\nIt seems the tokenizer used for the default Sentiment Analysis pipeline was not aligned with the actual model. More precisely, the model is using an **uncased** vocab while the tokenizer is **cased**.\r\n\r\nI've opened a PR(#4264) to solve the issue, if you can/want to give it a try and let us know if it solves the issue :).", "> Hi @nimahm2020,\r\n> \r\n> Thanks for reporting.\r\n> It seems the tokenizer used for the default Sentiment Analysis pipeline was not aligned with the actual model. More precisely, the model is using an **uncased** vocab while the tokenizer is **cased**.\r\n> \r\n> I've opened a PR(#4264) to solve the issue, if you can/want to give it a try and let us know if it solves the issue :).\r\n\r\nHi @mfuntowicz \r\nIn term of accuracy , accidentally, I found that Transformer 2.8 provide the same accuracy performance as it was before . It seems that nlp=pipline (sentiment- analysis ) in Transformer 2.9 is a bit under-estimated . \r\nAs a brief ; Transformer connects to Flask with following modifications that i have no clue why it should be : \r\n1- run Flask app with debug=False \r\n2- install Transfomer 2.8 ( NOT last version is 2.9) \r\n\r\nmore deep explanation and comments are always appreciated . \r\n", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,594
1,594
NONE
null
# ❓ Questions & Help I am building a web-frame with Flask to run Transformer pipeline ( sentiment - analysis ) over Excel columns text. However , In first try running Flask app , gives following error as : ModuleNotFoundError: No module named 'tensorflow_core._api' after few days, without any success, As mentioned in other pages , issue will be resolved or better saying ignored by change debug Flask run flag from TRUE to FALSE as below : app.run(host='0.0.0.0', debug=False) It runs ! Webpage opens, Excel sheet uploaded to server and then after calling pipline Transformer !! Now i am facing very strange!!! behaviour ! It seems that pipline works !! but results are different than stand alone run!! ! In light be better clarification For instance : Downloading: 100%|█████████████████████████████████████████████████████████████| 230/230 [00:00<00:00, 255kB/s] amazing job ---------------- [{'label': 'POSITIVE', 'score': 0.99987316}] sounds misleading ---------------- [{'label': 'NEGATIVE', 'score': 0.9996892}] amazing job ---------------- [{'label': 'POSITIVE', 'score': 0.99987316}] sounds cheap ---------------- [{'label': 'NEGATIVE', 'score': 0.99980205}] Uninteresting. ---------------- [{'label': 'NEGATIVE', 'score': 0.9997152}] This is an Interesting item. ---------------- [{'label': 'POSITIVE', 'score': 0.99984246}] very good ---------------- [{'label': 'POSITIVE', 'score': 0.999852}] this is inappropriate for you ---------------- [{'label': 'NEGATIVE', 'score': 0.99970394}] this is appropriate for you ---------------- [{'label': 'POSITIVE', 'score': 0.99979025}] very bad ---------------- [{'label': 'NEGATIVE', 'score': 0.99978846}] will be like as below after calling in FLASK app amazing job | 0.793442070484161 | NEGATIVE sounds misleading | 0.940393328666687 | POSITIVE amazing job | 0.793442070484161 | NEGATIVE sounds cheap | 0.934843122959137 | NEGATIVE Uninteresting. | 0.995108544826508 | NEGATIVE This is an Interesting item. | 0.946804642677307 | NEGATIVE very good | 0.77636182308197 | POSITIVE this is inappropriate for you | 0.945333242416382 | NEGATIVE this is appropriate for you | 0.942687690258026 | NEGATIVE very bad | 0.623483657836914 | NEGATIVE Your help and comments are greatly appreciated. ## Details <!-- You should first ask your question on SO, and only if you didn't get an answer ask it here on GitHub. --> **A link to original question on Stack Overflow**:
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4260/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4260/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4259
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4259/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4259/comments
https://api.github.com/repos/huggingface/transformers/issues/4259/events
https://github.com/huggingface/transformers/pull/4259
615,270,055
MDExOlB1bGxSZXF1ZXN0NDE1NjM3NDI3
4,259
Fix bug in sample code
{ "login": "joehalliwell", "id": 8868, "node_id": "MDQ6VXNlcjg4Njg=", "avatar_url": "https://avatars.githubusercontent.com/u/8868?v=4", "gravatar_id": "", "url": "https://api.github.com/users/joehalliwell", "html_url": "https://github.com/joehalliwell", "followers_url": "https://api.github.com/users/joehalliwell/followers", "following_url": "https://api.github.com/users/joehalliwell/following{/other_user}", "gists_url": "https://api.github.com/users/joehalliwell/gists{/gist_id}", "starred_url": "https://api.github.com/users/joehalliwell/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/joehalliwell/subscriptions", "organizations_url": "https://api.github.com/users/joehalliwell/orgs", "repos_url": "https://api.github.com/users/joehalliwell/repos", "events_url": "https://api.github.com/users/joehalliwell/events{/privacy}", "received_events_url": "https://api.github.com/users/joehalliwell/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "It seems this example was not updated after #3734. This is not the correct way to do it, as it now requires the user to specify the entire context all the time. Will open a PR now.", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,594
1,594
NONE
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4259/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4259/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4259", "html_url": "https://github.com/huggingface/transformers/pull/4259", "diff_url": "https://github.com/huggingface/transformers/pull/4259.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4259.patch", "merged_at": null }
https://api.github.com/repos/huggingface/transformers/issues/4258
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4258/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4258/comments
https://api.github.com/repos/huggingface/transformers/issues/4258/events
https://github.com/huggingface/transformers/issues/4258
615,260,837
MDU6SXNzdWU2MTUyNjA4Mzc=
4,258
Model call with `inputs_embeds` does not match that with `input_ids`
{ "login": "vman049", "id": 7951895, "node_id": "MDQ6VXNlcjc5NTE4OTU=", "avatar_url": "https://avatars.githubusercontent.com/u/7951895?v=4", "gravatar_id": "", "url": "https://api.github.com/users/vman049", "html_url": "https://github.com/vman049", "followers_url": "https://api.github.com/users/vman049/followers", "following_url": "https://api.github.com/users/vman049/following{/other_user}", "gists_url": "https://api.github.com/users/vman049/gists{/gist_id}", "starred_url": "https://api.github.com/users/vman049/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vman049/subscriptions", "organizations_url": "https://api.github.com/users/vman049/orgs", "repos_url": "https://api.github.com/users/vman049/repos", "events_url": "https://api.github.com/users/vman049/events{/privacy}", "received_events_url": "https://api.github.com/users/vman049/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "I was incorrectly treating the output of the first layer as the actual embedding lookup when it is in fact the embedding lookup *plus* positional and token type embeddings. See [here](https://stackoverflow.com/a/61704348/424306) for more details." ]
1,589
1,589
1,589
NONE
null
# 🐛 Bug ## Information Model I am using (Bert, XLNet ...): Bert Language I am using the model on (English, Chinese ...): English The problem arises when using: my own modified scripts: (details below) ## To reproduce Steps to reproduce the behavior: ``` import tensorflow as tf from transformers import BertConfig, BertTokenizer, TFBertModel bert_tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') input_ids = tf.constant(bert_tokenizer.encode("Hello, my dog is cute", add_special_tokens=True))[None, :] attention_mask = tf.stack([tf.ones(shape=(len(sent),)) for sent in input_ids]) token_type_ids = tf.stack([tf.ones(shape=(len(sent),)) for sent in input_ids]) config = BertConfig.from_pretrained('bert-base-uncased', output_hidden_states=True) bert_model = TFBertModel.from_pretrained('bert-base-uncased', config=config) result = bert_model(inputs={'input_ids': input_ids, 'attention_mask': attention_mask, 'token_type_ids': token_type_ids}) inputs_embeds = result[-1][0] result2 = bert_model(inputs={'inputs_embeds': inputs_embeds, 'attention_mask': attention_mask, 'token_type_ids': token_type_ids}) print(tf.reduce_sum(tf.abs(result[0] - result2[0]))) # 458.2522, should be 0 ``` ## Expected behavior The HuggingFace BERT TensorFlow implementation allows us to feed in a precomputed embedding in place of the embedding lookup that is native to BERT. This is done using the model's `call` method's optional parameter `inputs_embeds` (in place of `input_ids`). To test this out, I wanted to make sure that if I did feed in BERT's embedding lookup, I would get the same result as having fed in the `input_ids` themselves. The result of BERT's embedding lookup can be obtained by setting the BERT configuration parameter `output_hidden_states` to `True` and extracting the first tensor from the last output of the call method. (The remaining 12 outputs correspond to each of the 12 hidden layers.) Thus, I wrote the above code to test my hypothesis. The output of the `call` method is a tuple, and the first element of this tuple is the output of the last layer of BERT. Thus, I expected `result[0]` and `result2[0]` to match. Why is this not the case? ## Environment info <!-- You can run the command `transformers-cli env` and copy-and-paste its output below. Don't forget to fill out the missing fields in that output! --> - `transformers` version: 2.5.1 - Platform: Linux-3.10.0-1127.el7.x86_64-x86_64-with-debian-stretch-sid - Python version: 3.6.10 - PyTorch version (GPU?): not installed (NA) - Tensorflow version (GPU?): 2.1.0 (True) - Using GPU in script?: No - Using distributed or parallel set-up in script?: No
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4258/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4258/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4257
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4257/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4257/comments
https://api.github.com/repos/huggingface/transformers/issues/4257/events
https://github.com/huggingface/transformers/pull/4257
615,245,432
MDExOlB1bGxSZXF1ZXN0NDE1NjIwMzE4
4,257
added functionality for electra classification head
{ "login": "liuzzi", "id": 3812369, "node_id": "MDQ6VXNlcjM4MTIzNjk=", "avatar_url": "https://avatars.githubusercontent.com/u/3812369?v=4", "gravatar_id": "", "url": "https://api.github.com/users/liuzzi", "html_url": "https://github.com/liuzzi", "followers_url": "https://api.github.com/users/liuzzi/followers", "following_url": "https://api.github.com/users/liuzzi/following{/other_user}", "gists_url": "https://api.github.com/users/liuzzi/gists{/gist_id}", "starred_url": "https://api.github.com/users/liuzzi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/liuzzi/subscriptions", "organizations_url": "https://api.github.com/users/liuzzi/orgs", "repos_url": "https://api.github.com/users/liuzzi/repos", "events_url": "https://api.github.com/users/liuzzi/events{/privacy}", "received_events_url": "https://api.github.com/users/liuzzi/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "This is great, thanks @liuzzi!\r\n\r\nWe would need to add the corresponding tests. Can you do it, or would you like me to do it? If so, may I push directly on your fork?", "@LysandreJik sure! i just invited you to collaborate. I haven't been inside the transformers testing code so it'd probably be much faster for you to do. Let me know if you have any questions/if i can help.", "I just pushed the tests on it, thanks for your contribution!", "Pushed a style change, rebased and merged into master. Thanks @liuzzi !" ]
1,589
1,590
1,590
CONTRIBUTOR
null
Added functionality for an electra classification head following the google repo. Tested and trains fine with the run_glue script. I was testing on my own repurposed classification problems so i didnt evaluate the actual GLUE accuracies, but can confirm that it is getting competitive results on my own problems. Saw a few requests for this, thought it could benefit the community. Originally I used a tanh activation in the classification head. (which in my tests reliably performed better than a gelu activation) But looking over the google code, it seems that they used gelu, so to keep the integrity of their paper im committing gelu here. I also opted to make a ClassificationHead class instead of integrating a pooling layer in the base model class because i wasn't sure if that would affect other things, or run time in non sequence-classification tasks.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4257/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4257/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4257", "html_url": "https://github.com/huggingface/transformers/pull/4257", "diff_url": "https://github.com/huggingface/transformers/pull/4257.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4257.patch", "merged_at": 1590155301000 }
https://api.github.com/repos/huggingface/transformers/issues/4256
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4256/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4256/comments
https://api.github.com/repos/huggingface/transformers/issues/4256/events
https://github.com/huggingface/transformers/issues/4256
615,238,397
MDU6SXNzdWU2MTUyMzgzOTc=
4,256
Vaswani's Transformer (Encoder-Decoder) decoding methods
{ "login": "manzar96", "id": 38495091, "node_id": "MDQ6VXNlcjM4NDk1MDkx", "avatar_url": "https://avatars.githubusercontent.com/u/38495091?v=4", "gravatar_id": "", "url": "https://api.github.com/users/manzar96", "html_url": "https://github.com/manzar96", "followers_url": "https://api.github.com/users/manzar96/followers", "following_url": "https://api.github.com/users/manzar96/following{/other_user}", "gists_url": "https://api.github.com/users/manzar96/gists{/gist_id}", "starred_url": "https://api.github.com/users/manzar96/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/manzar96/subscriptions", "organizations_url": "https://api.github.com/users/manzar96/orgs", "repos_url": "https://api.github.com/users/manzar96/repos", "events_url": "https://api.github.com/users/manzar96/events{/privacy}", "received_events_url": "https://api.github.com/users/manzar96/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "Hello @manzar96 \r\nThe `.generate` method can be used with any HF model with a LM head on top.", "Ok thank you.\r\nSo it can be used only with those models https://pytorch.org/hub/huggingface_pytorch-transformers/ (having a LM head on top) ", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,594
1,594
NONE
null
Hi, I recently studied this blog https://huggingface.co/blog/how-to-generate for using different decoding methods with PreTrained Models. I would like to ask if it is possible to use those methods with the simple Encoder-Decoder Transformer model (as mentioned in Vaswani's paper) (as it is available in pytorch library "torch.nn") or I have to implement those decoding methods by my own. Thank you in advance.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4256/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4256/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4255
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4255/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4255/comments
https://api.github.com/repos/huggingface/transformers/issues/4255/events
https://github.com/huggingface/transformers/pull/4255
615,204,838
MDExOlB1bGxSZXF1ZXN0NDE1NTkzNjgy
4,255
bert uncased models needs lower casing option turned on in the example code.
{ "login": "rsanjaykamath", "id": 18527321, "node_id": "MDQ6VXNlcjE4NTI3MzIx", "avatar_url": "https://avatars.githubusercontent.com/u/18527321?v=4", "gravatar_id": "", "url": "https://api.github.com/users/rsanjaykamath", "html_url": "https://github.com/rsanjaykamath", "followers_url": "https://api.github.com/users/rsanjaykamath/followers", "following_url": "https://api.github.com/users/rsanjaykamath/following{/other_user}", "gists_url": "https://api.github.com/users/rsanjaykamath/gists{/gist_id}", "starred_url": "https://api.github.com/users/rsanjaykamath/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rsanjaykamath/subscriptions", "organizations_url": "https://api.github.com/users/rsanjaykamath/orgs", "repos_url": "https://api.github.com/users/rsanjaykamath/repos", "events_url": "https://api.github.com/users/rsanjaykamath/events{/privacy}", "received_events_url": "https://api.github.com/users/rsanjaykamath/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "Those models should contain config that initializes their tokenizer with the correct `do_lower_case=True` option. Is this not the case?\r\n\r\ni.e. we are moving the tokenizer configuration out of those example scripts (see updated scripts for `Trainer` at https://github.com/huggingface/transformers/tree/master/examples).", "I haven't gone through the recent update sorry. \r\nIt looks like the [examples page](https://github.com/huggingface/transformers/tree/master/examples/) has completely changed now. \r\nBut in the folder of [question-answering](https://github.com/huggingface/transformers/tree/master/examples/question-answering), the configuration to replicate results still remains the same. \r\n\r\nShall I modify this there and create a request ? \r\nBecause the `do_lower_case` argument is a `store_true` argument and not a `boolean` with default as `true`. \r\n\r\nI spent 3 runs to realise the error because it worked correctly with cased models. \r\n\r\nReference https://github.com/huggingface/transformers/blob/4658896ee105c504eba23db2efefc5fe14191b81/examples/question-answering/run_squad.py#L579\r\n\r\n\r\n", "Closing this b/c #4245 was merged\r\n\r\n(we still need to investigate why the lowercasing is not properly populated by the model's config)\r\n\r\n" ]
1,589
1,590
1,590
NONE
null
The command to replicate bert-base-uncased model and bert-large-uncased-whole-word-masking model results on Squad requires --do_lower_case to be used. If not, the result is low.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4255/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4255/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4255", "html_url": "https://github.com/huggingface/transformers/pull/4255", "diff_url": "https://github.com/huggingface/transformers/pull/4255.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4255.patch", "merged_at": null }
https://api.github.com/repos/huggingface/transformers/issues/4254
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4254/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4254/comments
https://api.github.com/repos/huggingface/transformers/issues/4254/events
https://github.com/huggingface/transformers/issues/4254
615,192,621
MDU6SXNzdWU2MTUxOTI2MjE=
4,254
'utf-8' codec can't decode byte 0x80 in position 229888: invalid start byte
{ "login": "codehunk628", "id": 51091425, "node_id": "MDQ6VXNlcjUxMDkxNDI1", "avatar_url": "https://avatars.githubusercontent.com/u/51091425?v=4", "gravatar_id": "", "url": "https://api.github.com/users/codehunk628", "html_url": "https://github.com/codehunk628", "followers_url": "https://api.github.com/users/codehunk628/followers", "following_url": "https://api.github.com/users/codehunk628/following{/other_user}", "gists_url": "https://api.github.com/users/codehunk628/gists{/gist_id}", "starred_url": "https://api.github.com/users/codehunk628/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/codehunk628/subscriptions", "organizations_url": "https://api.github.com/users/codehunk628/orgs", "repos_url": "https://api.github.com/users/codehunk628/repos", "events_url": "https://api.github.com/users/codehunk628/events{/privacy}", "received_events_url": "https://api.github.com/users/codehunk628/received_events", "type": "User", "site_admin": false }
[ { "id": 1834081910, "node_id": "MDU6TGFiZWwxODM0MDgxOTEw", "url": "https://api.github.com/repos/huggingface/transformers/labels/Usage", "name": "Usage", "color": "e28436", "default": false, "description": "General questions about the library" } ]
closed
false
null
[]
[ "I don't think you can load .tars directly. Simply use the name as described in [the model page](https://huggingface.co/allenai/scibert_scivocab_uncased), and it should work.\r\n\r\n```python\r\ntokenizer = AutoTokenizer.from_pretrained(\"allenai/scibert_scivocab_uncased\")\r\n```", "Thank You @BramVanroy .\r\nIts working." ]
1,589
1,589
1,589
NONE
null
os : google colab from transformers import * tokenizer = AutoTokenizer.from_pretrained('https://s3-us-west-2.amazonaws.com/ai2-s2-research/scibert/huggingface_pytorch/scibert_scivocab_uncased.tar') ![SCI_BERT](https://user-images.githubusercontent.com/51091425/81477029-d94ddc00-9232-11ea-90ca-827a0e0ecc80.PNG)
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4254/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4254/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4253
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4253/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4253/comments
https://api.github.com/repos/huggingface/transformers/issues/4253/events
https://github.com/huggingface/transformers/pull/4253
615,177,257
MDExOlB1bGxSZXF1ZXN0NDE1NTc2MTE2
4,253
Conversion script to export transformers models to ONNX IR.
{ "login": "mfuntowicz", "id": 2241520, "node_id": "MDQ6VXNlcjIyNDE1MjA=", "avatar_url": "https://avatars.githubusercontent.com/u/2241520?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mfuntowicz", "html_url": "https://github.com/mfuntowicz", "followers_url": "https://api.github.com/users/mfuntowicz/followers", "following_url": "https://api.github.com/users/mfuntowicz/following{/other_user}", "gists_url": "https://api.github.com/users/mfuntowicz/gists{/gist_id}", "starred_url": "https://api.github.com/users/mfuntowicz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mfuntowicz/subscriptions", "organizations_url": "https://api.github.com/users/mfuntowicz/orgs", "repos_url": "https://api.github.com/users/mfuntowicz/repos", "events_url": "https://api.github.com/users/mfuntowicz/events{/privacy}", "received_events_url": "https://api.github.com/users/mfuntowicz/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4253?src=pr&el=h1) Report\n> Merging [#4253](https://codecov.io/gh/huggingface/transformers/pull/4253?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/c558761ad11beba5e70dd505e1c97bdc4eb6ee9c&el=desc) will **not change** coverage.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4253/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4253?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4253 +/- ##\n=======================================\n Coverage 78.16% 78.16% \n=======================================\n Files 120 120 \n Lines 20005 20005 \n=======================================\n Hits 15637 15637 \n Misses 4368 4368 \n```\n\n\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4253?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4253?src=pr&el=footer). Last update [c558761...c558761](https://codecov.io/gh/huggingface/transformers/pull/4253?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "For the notebook:\r\n```\r\n \"environ[\\\"OMP_NUM_THREADS\\\"] = str(cpu_count(logical=True))\\n\",\r\n \"environ[\\\"OMP_WAIT_POLICY\\\"] = 'ACTIVE'\r\n```\r\n It is better to place the environ setting before importing onnxruntime. I used to find that placing these settings after importing onnxruntime does not work.\r\n\r\n\r\n```\r\n options.execution_mode = ExecutionMode.ORT_SEQUENTIAL \r\n```\r\nORT_SEQUENTIAL is the default value so the line is optional.", "@tianleiwu I agree with your regarding optional argument, especially GPT2 and the past context which might provide a significant boost in performance.\r\n\r\nFor the scope of this release, I decided to not provide support for this, as it would have required much more thinking / changes in the library. \r\n\r\nWe might have a look at possible solutions for this in short/mid term 👍 " ]
1,589
1,589
1,589
MEMBER
null
This PR adds conversion script to export our models to ONNX IR. Plan is to support both PyTorch and TensorFlow: - [x] PyTorch - [x] TensorFlow TensorFlow currently blocked because of an issue in the conversion script provided by ONNX (seems fixed on master : https://github.com/onnx/tensorflow-onnx/issues/876) _PS: PR recreated because the first one got corrupted (#4176)._
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4253/reactions", "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 1, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4253/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4253", "html_url": "https://github.com/huggingface/transformers/pull/4253", "diff_url": "https://github.com/huggingface/transformers/pull/4253.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4253.patch", "merged_at": 1589488553000 }
https://api.github.com/repos/huggingface/transformers/issues/4252
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4252/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4252/comments
https://api.github.com/repos/huggingface/transformers/issues/4252/events
https://github.com/huggingface/transformers/issues/4252
615,175,259
MDU6SXNzdWU2MTUxNzUyNTk=
4,252
How to specify a TPU IP for run_tf_glue.py?
{ "login": "mar-muel", "id": 19345805, "node_id": "MDQ6VXNlcjE5MzQ1ODA1", "avatar_url": "https://avatars.githubusercontent.com/u/19345805?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mar-muel", "html_url": "https://github.com/mar-muel", "followers_url": "https://api.github.com/users/mar-muel/followers", "following_url": "https://api.github.com/users/mar-muel/following{/other_user}", "gists_url": "https://api.github.com/users/mar-muel/gists{/gist_id}", "starred_url": "https://api.github.com/users/mar-muel/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mar-muel/subscriptions", "organizations_url": "https://api.github.com/users/mar-muel/orgs", "repos_url": "https://api.github.com/users/mar-muel/repos", "events_url": "https://api.github.com/users/mar-muel/events{/privacy}", "received_events_url": "https://api.github.com/users/mar-muel/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "TPUs can be autodiscovered if you use them through AI-platform by running the trainer with `gcloud ai-platform jobs submit training ...` This is the advised usage of TPUs I put in the trainer.\r\n\r\nNevertheless if your want to use it through its name, this is done in the following PR #4270 thanks to @ViktorAlm", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,595
1,595
CONTRIBUTOR
null
Hi team! I have a VM on Google Cloud and a TPU. When running your example script `run_tf_glue.py` there is no option for specifying a TPU IP. It seems like the TPU cannot be auto-discovered and then training falls back to training on CPU 🐢
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4252/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4252/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4251
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4251/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4251/comments
https://api.github.com/repos/huggingface/transformers/issues/4251/events
https://github.com/huggingface/transformers/issues/4251
615,170,658
MDU6SXNzdWU2MTUxNzA2NTg=
4,251
Encoder - Decoder loading wrong weights and missing decoders
{ "login": "flozi00", "id": 47894090, "node_id": "MDQ6VXNlcjQ3ODk0MDkw", "avatar_url": "https://avatars.githubusercontent.com/u/47894090?v=4", "gravatar_id": "", "url": "https://api.github.com/users/flozi00", "html_url": "https://github.com/flozi00", "followers_url": "https://api.github.com/users/flozi00/followers", "following_url": "https://api.github.com/users/flozi00/following{/other_user}", "gists_url": "https://api.github.com/users/flozi00/gists{/gist_id}", "starred_url": "https://api.github.com/users/flozi00/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/flozi00/subscriptions", "organizations_url": "https://api.github.com/users/flozi00/orgs", "repos_url": "https://api.github.com/users/flozi00/repos", "events_url": "https://api.github.com/users/flozi00/events{/privacy}", "received_events_url": "https://api.github.com/users/flozi00/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,589
1,589
1,589
CONTRIBUTOR
null
# 🐛 Bug ## Information Model I am using (Bert, XLNet ...): Roberta as encoder and Bert as decoder Language I am using the model on (English, Chinese ...): English The problem arises when using: * [x] my own modified scripts: (give details below) The tasks I am working on is: * [x] my own task or dataset: (give details below) ## To reproduce Steps to reproduce the behavior: 1. https://github.com/ThilinaRajapakse/simpletransformers/pull/360 ## Expected behavior Predicting the same string before saving and after loading the saved model are completely different. Expected that i get the same results both times Furthermore your tutorial on medium is not working, caused missing decoder models. Link to medium: https://medium.com/huggingface/encoder-decoders-in-transformers-a-hybrid-pre-trained-architecture-for-seq2seq-af4d7bf14bb8 There is missing an argument in the forward function: `TypeError: forward() got an unexpected keyword argument 'encoder_hidden_states'` ## Environment info <!-- You can run the command `transformers-cli env` and copy-and-paste its output below. Don't forget to fill out the missing fields in that output! --> - `transformers` version: - Platform: Linux - Python version: 3.7 - PyTorch version (GPU?): GPU 1.4.0 - Tensorflow version (GPU?): - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4251/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4251/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4250
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4250/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4250/comments
https://api.github.com/repos/huggingface/transformers/issues/4250/events
https://github.com/huggingface/transformers/issues/4250
615,152,099
MDU6SXNzdWU2MTUxNTIwOTk=
4,250
[Request] NER Scripts on CoNLL 2003 dataset
{ "login": "gyuwankim", "id": 13251652, "node_id": "MDQ6VXNlcjEzMjUxNjUy", "avatar_url": "https://avatars.githubusercontent.com/u/13251652?v=4", "gravatar_id": "", "url": "https://api.github.com/users/gyuwankim", "html_url": "https://github.com/gyuwankim", "followers_url": "https://api.github.com/users/gyuwankim/followers", "following_url": "https://api.github.com/users/gyuwankim/following{/other_user}", "gists_url": "https://api.github.com/users/gyuwankim/gists{/gist_id}", "starred_url": "https://api.github.com/users/gyuwankim/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/gyuwankim/subscriptions", "organizations_url": "https://api.github.com/users/gyuwankim/orgs", "repos_url": "https://api.github.com/users/gyuwankim/repos", "events_url": "https://api.github.com/users/gyuwankim/events{/privacy}", "received_events_url": "https://api.github.com/users/gyuwankim/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null }, { "id": 1834060867, "node_id": "MDU6TGFiZWwxODM0MDYwODY3", "url": "https://api.github.com/repos/huggingface/transformers/labels/Ex:%20Named%20Entity%20Recognition", "name": "Ex: Named Entity Recognition", "color": "06FFD8", "default": false, "description": "" }, { "id": 1834067346, "node_id": "MDU6TGFiZWwxODM0MDY3MzQ2", "url": "https://api.github.com/repos/huggingface/transformers/labels/Documentation", "name": "Documentation", "color": "77cc3b", "default": false, "description": "" } ]
closed
false
{ "login": "stefan-it", "id": 20651387, "node_id": "MDQ6VXNlcjIwNjUxMzg3", "avatar_url": "https://avatars.githubusercontent.com/u/20651387?v=4", "gravatar_id": "", "url": "https://api.github.com/users/stefan-it", "html_url": "https://github.com/stefan-it", "followers_url": "https://api.github.com/users/stefan-it/followers", "following_url": "https://api.github.com/users/stefan-it/following{/other_user}", "gists_url": "https://api.github.com/users/stefan-it/gists{/gist_id}", "starred_url": "https://api.github.com/users/stefan-it/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stefan-it/subscriptions", "organizations_url": "https://api.github.com/users/stefan-it/orgs", "repos_url": "https://api.github.com/users/stefan-it/repos", "events_url": "https://api.github.com/users/stefan-it/events{/privacy}", "received_events_url": "https://api.github.com/users/stefan-it/received_events", "type": "User", "site_admin": false }
[ { "login": "stefan-it", "id": 20651387, "node_id": "MDQ6VXNlcjIwNjUxMzg3", "avatar_url": "https://avatars.githubusercontent.com/u/20651387?v=4", "gravatar_id": "", "url": "https://api.github.com/users/stefan-it", "html_url": "https://github.com/stefan-it", "followers_url": "https://api.github.com/users/stefan-it/followers", "following_url": "https://api.github.com/users/stefan-it/following{/other_user}", "gists_url": "https://api.github.com/users/stefan-it/gists{/gist_id}", "starred_url": "https://api.github.com/users/stefan-it/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stefan-it/subscriptions", "organizations_url": "https://api.github.com/users/stefan-it/orgs", "repos_url": "https://api.github.com/users/stefan-it/repos", "events_url": "https://api.github.com/users/stefan-it/events{/privacy}", "received_events_url": "https://api.github.com/users/stefan-it/received_events", "type": "User", "site_admin": false } ]
[ "Hi @gyuwankim the problem with English CoNLL dataset is, that it is not freely available (because it requires access to Reuters corpora in order to create it from scratch with the provided scripts).\r\n\r\nYou can find the dataset somehow on GitHub, but legally this is very dubious (and you have no guarantee that it is the original dataset).\r\n\r\nThat's the reason why I did use the GermEval 2014 dataset :)", "But what you think about adding a detailed description of training a NER model on the WNUT17 dataset?\r\n\r\nData can be accessed here: https://github.com/juand-r/entity-recognition-datasets/tree/master/data/WNUT17\r\n\r\nI could add a short example with some resuls (for other Transformer-based models as well). So we have both German and an English example of how to use the NER script :)\r\n\r\n/cc @julien-c ", "Additionally, the BERT evaluation strategy cannot be simply reproduced, see this [thread](https://github.com/allenai/allennlp/pull/2067#issuecomment-443961816) on the problem.\r\n\r\n", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,595
1,595
NONE
null
# 🚀 Feature request <!-- A clear and concise description of the feature proposal. Please provide a link to the paper and code in case they exist. --> ## Motivation Current NER scripts (data preparation, train, and evaluation) is for the GermEval 2014 dataset. It is very nice. However, according to the original BERT paper, experiments are done on the CoNLL-2003 dataset. It would be much better if the NER script could reproduce the results on this dataset. <!-- Please outline the motivation for the proposal. Is your feature request related to a problem? e.g., I'm always frustrated when [...]. If this is related to another GitHub issue, please link here too. --> ## Your contribution Looking forward to the feedback. Thanks in advance! <!-- Is there any way that you could help, e.g. by submitting a PR? Make sure to read the CONTRIBUTING.MD readme: https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md -->
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4250/reactions", "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4250/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4249
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4249/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4249/comments
https://api.github.com/repos/huggingface/transformers/issues/4249/events
https://github.com/huggingface/transformers/pull/4249
615,142,341
MDExOlB1bGxSZXF1ZXN0NDE1NTUyNjYx
4,249
[docs] fix typo
{ "login": "flozi00", "id": 47894090, "node_id": "MDQ6VXNlcjQ3ODk0MDkw", "avatar_url": "https://avatars.githubusercontent.com/u/47894090?v=4", "gravatar_id": "", "url": "https://api.github.com/users/flozi00", "html_url": "https://github.com/flozi00", "followers_url": "https://api.github.com/users/flozi00/followers", "following_url": "https://api.github.com/users/flozi00/following{/other_user}", "gists_url": "https://api.github.com/users/flozi00/gists{/gist_id}", "starred_url": "https://api.github.com/users/flozi00/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/flozi00/subscriptions", "organizations_url": "https://api.github.com/users/flozi00/orgs", "repos_url": "https://api.github.com/users/flozi00/repos", "events_url": "https://api.github.com/users/flozi00/events{/privacy}", "received_events_url": "https://api.github.com/users/flozi00/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,589
1,589
1,589
CONTRIBUTOR
null
replace sequence classification with question answering in AutoModelForQuestionAnswering class
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4249/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4249/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4249", "html_url": "https://github.com/huggingface/transformers/pull/4249", "diff_url": "https://github.com/huggingface/transformers/pull/4249.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4249.patch", "merged_at": 1589134029000 }
https://api.github.com/repos/huggingface/transformers/issues/4248
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4248/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4248/comments
https://api.github.com/repos/huggingface/transformers/issues/4248/events
https://github.com/huggingface/transformers/issues/4248
615,142,250
MDU6SXNzdWU2MTUxNDIyNTA=
4,248
sentiment analysis pipeline provides option to output the original rating than positive/negative tags
{ "login": "junhua", "id": 3516360, "node_id": "MDQ6VXNlcjM1MTYzNjA=", "avatar_url": "https://avatars.githubusercontent.com/u/3516360?v=4", "gravatar_id": "", "url": "https://api.github.com/users/junhua", "html_url": "https://github.com/junhua", "followers_url": "https://api.github.com/users/junhua/followers", "following_url": "https://api.github.com/users/junhua/following{/other_user}", "gists_url": "https://api.github.com/users/junhua/gists{/gist_id}", "starred_url": "https://api.github.com/users/junhua/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/junhua/subscriptions", "organizations_url": "https://api.github.com/users/junhua/orgs", "repos_url": "https://api.github.com/users/junhua/repos", "events_url": "https://api.github.com/users/junhua/events{/privacy}", "received_events_url": "https://api.github.com/users/junhua/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,589
1,594
1,594
NONE
null
It'd be helpful to provide an option for sentiment analysis pipeline output the original ratings rather than the positive/negative tags. Also the documentation doesn't really explain what the output scores mean..
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4248/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4248/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4247
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4247/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4247/comments
https://api.github.com/repos/huggingface/transformers/issues/4247/events
https://github.com/huggingface/transformers/pull/4247
615,111,074
MDExOlB1bGxSZXF1ZXN0NDE1NTMwMjA2
4,247
removed variable api from pplm example
{ "login": "prajjwal1", "id": 24690051, "node_id": "MDQ6VXNlcjI0NjkwMDUx", "avatar_url": "https://avatars.githubusercontent.com/u/24690051?v=4", "gravatar_id": "", "url": "https://api.github.com/users/prajjwal1", "html_url": "https://github.com/prajjwal1", "followers_url": "https://api.github.com/users/prajjwal1/followers", "following_url": "https://api.github.com/users/prajjwal1/following{/other_user}", "gists_url": "https://api.github.com/users/prajjwal1/gists{/gist_id}", "starred_url": "https://api.github.com/users/prajjwal1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/prajjwal1/subscriptions", "organizations_url": "https://api.github.com/users/prajjwal1/orgs", "repos_url": "https://api.github.com/users/prajjwal1/repos", "events_url": "https://api.github.com/users/prajjwal1/events{/privacy}", "received_events_url": "https://api.github.com/users/prajjwal1/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,589
1,589
1,589
CONTRIBUTOR
null
Same as previous [PR](https://github.com/huggingface/transformers/pull/4156)
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4247/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4247/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4247", "html_url": "https://github.com/huggingface/transformers/pull/4247", "diff_url": "https://github.com/huggingface/transformers/pull/4247.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4247.patch", "merged_at": null }
https://api.github.com/repos/huggingface/transformers/issues/4246
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4246/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4246/comments
https://api.github.com/repos/huggingface/transformers/issues/4246/events
https://github.com/huggingface/transformers/issues/4246
615,077,459
MDU6SXNzdWU2MTUwNzc0NTk=
4,246
Structuring Dataset for Fine Tuning GPT-2 with Song Lyrics?
{ "login": "1337-Pete", "id": 43712596, "node_id": "MDQ6VXNlcjQzNzEyNTk2", "avatar_url": "https://avatars.githubusercontent.com/u/43712596?v=4", "gravatar_id": "", "url": "https://api.github.com/users/1337-Pete", "html_url": "https://github.com/1337-Pete", "followers_url": "https://api.github.com/users/1337-Pete/followers", "following_url": "https://api.github.com/users/1337-Pete/following{/other_user}", "gists_url": "https://api.github.com/users/1337-Pete/gists{/gist_id}", "starred_url": "https://api.github.com/users/1337-Pete/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/1337-Pete/subscriptions", "organizations_url": "https://api.github.com/users/1337-Pete/orgs", "repos_url": "https://api.github.com/users/1337-Pete/repos", "events_url": "https://api.github.com/users/1337-Pete/events{/privacy}", "received_events_url": "https://api.github.com/users/1337-Pete/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "By the way, did this approach work for you? I tried a similar one and I couldn't stop getting an error about incompatible output shapes when calculating sparse categorical accuracy.", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n", "Any solution or suggestions yet? @1337-Pete " ]
1,588
1,636
1,599
NONE
null
I'm looking to fine tune a GPT-2 model with several songs from the same artist. However, I'm not exactly sure how I should be feeding nearly 300 songs into the model to learn from. Currently, I'm breaking the lyrics into blocks of 100 and feeding them into my model: ``` lyrics = open('/JayZ_lyrics.txt', "r", encoding="utf-8").read() lyrics = lyrics.split('\n') lyrics = ''.join(lyrics) tokenizer = GPT2Tokenizer.from_pretrained('distilgpt2') tokenized_text = tokenizer.encode(lyrics) examples = [] block_size = 100 for i in range(0, len(tokenized_text)-block_size+1, block_size): examples.append(tokenized_text[i:i+block_size]) inputs, labels = [], [] for ex in examples: inputs.append(ex[:-1]) labels.append(ex[1:]) ``` Then, I feed my dataset into the model and train on it. ``` dataset= tf.data.Dataset.from_tensor_slices((inputs,labels)) BATCH_SIZE = 16 dataset = dataset.batch(BATCH_SIZE, drop_remainder=True) optimizer = tf.keras.optimizers.Adam(epsilon=1e-08, clipnorm=1.0) loss = tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True) metric = tf.keras.metrics.SparseCategoricalAccuracy('accuracy') model = TFGPT2LMHeadModel.from_pretrained('distilgpt2') model.compile(optimizer=optimizer, loss=[loss, None, None, None, None, None, None], metrics=[metric]) model.fit(dataset, epochs=4, callbacks=[LRFinder()]) ``` Is this the right approach? Or, should I turn every song into a vector, find the len of longest song, pad the other songs to keep uniformity amongst vector lengths, feed in dataset. Also, should I include a BOS and/or EOS token `<|endoftext|>` for each block that I create?
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4246/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4246/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4245
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4245/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4245/comments
https://api.github.com/repos/huggingface/transformers/issues/4245/events
https://github.com/huggingface/transformers/pull/4245
615,073,186
MDExOlB1bGxSZXF1ZXN0NDE1NTAxODQz
4,245
Add back option --do_lower_case in SQuAD for uncased models
{ "login": "airsplay", "id": 2796554, "node_id": "MDQ6VXNlcjI3OTY1NTQ=", "avatar_url": "https://avatars.githubusercontent.com/u/2796554?v=4", "gravatar_id": "", "url": "https://api.github.com/users/airsplay", "html_url": "https://github.com/airsplay", "followers_url": "https://api.github.com/users/airsplay/followers", "following_url": "https://api.github.com/users/airsplay/following{/other_user}", "gists_url": "https://api.github.com/users/airsplay/gists{/gist_id}", "starred_url": "https://api.github.com/users/airsplay/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/airsplay/subscriptions", "organizations_url": "https://api.github.com/users/airsplay/orgs", "repos_url": "https://api.github.com/users/airsplay/repos", "events_url": "https://api.github.com/users/airsplay/events{/privacy}", "received_events_url": "https://api.github.com/users/airsplay/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4245?src=pr&el=h1) Report\n> Merging [#4245](https://codecov.io/gh/huggingface/transformers/pull/4245?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/7b75aa9fa55bee577e2c7403301ed31103125a35&el=desc) will **increase** coverage by `0.42%`.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4245/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4245?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4245 +/- ##\n==========================================\n+ Coverage 78.39% 78.82% +0.42% \n==========================================\n Files 120 120 \n Lines 19925 19925 \n==========================================\n+ Hits 15620 15705 +85 \n+ Misses 4305 4220 -85 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4245?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [src/transformers/modeling\\_tf\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4245/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `92.77% <0.00%> (-0.17%)` | :arrow_down: |\n| [src/transformers/modeling\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4245/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `90.96% <0.00%> (-0.13%)` | :arrow_down: |\n| [src/transformers/tokenization\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4245/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90b2tlbml6YXRpb25fdXRpbHMucHk=) | `89.48% <0.00%> (+0.11%)` | :arrow_up: |\n| [src/transformers/data/processors/squad.py](https://codecov.io/gh/huggingface/transformers/pull/4245/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9kYXRhL3Byb2Nlc3NvcnMvc3F1YWQucHk=) | `56.27% <0.00%> (+27.65%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4245?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4245?src=pr&el=footer). Last update [7b75aa9...f1caefd](https://codecov.io/gh/huggingface/transformers/pull/4245?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n" ]
1,588
1,590
1,590
CONTRIBUTOR
null
The option `--do_lower_case` is currently needed by the uncased models (i.e., bert-base-uncased, bert-large-uncased). The results w/ and w/o this option are shown below. The option was deleted in the current v2.9.0 version so this PR tries to add it back. This would not affect the cased models (i.e., RoBERTa, XLNet). Results of SQuAD v1.1: bert-base-uncased **without** `--do_lower_case`: 'exact': 73.83, 'f1': 82.22 bert-base-uncased **with** `--do_lower_cas`e: 'exact': 81.02, 'f1': 88.34
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4245/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4245/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4245", "html_url": "https://github.com/huggingface/transformers/pull/4245", "diff_url": "https://github.com/huggingface/transformers/pull/4245.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4245.patch", "merged_at": 1590541987000 }
https://api.github.com/repos/huggingface/transformers/issues/4244
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4244/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4244/comments
https://api.github.com/repos/huggingface/transformers/issues/4244/events
https://github.com/huggingface/transformers/pull/4244
615,053,367
MDExOlB1bGxSZXF1ZXN0NDE1NDg3MDYz
4,244
Allow gpt2 to be exported to valid ONNX
{ "login": "tianleiwu", "id": 30328909, "node_id": "MDQ6VXNlcjMwMzI4OTA5", "avatar_url": "https://avatars.githubusercontent.com/u/30328909?v=4", "gravatar_id": "", "url": "https://api.github.com/users/tianleiwu", "html_url": "https://github.com/tianleiwu", "followers_url": "https://api.github.com/users/tianleiwu/followers", "following_url": "https://api.github.com/users/tianleiwu/following{/other_user}", "gists_url": "https://api.github.com/users/tianleiwu/gists{/gist_id}", "starred_url": "https://api.github.com/users/tianleiwu/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/tianleiwu/subscriptions", "organizations_url": "https://api.github.com/users/tianleiwu/orgs", "repos_url": "https://api.github.com/users/tianleiwu/repos", "events_url": "https://api.github.com/users/tianleiwu/events{/privacy}", "received_events_url": "https://api.github.com/users/tianleiwu/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "@LysandreJik failing unittest seems unrelated to the change-set introduced in this PR", "Indeed @mfuntowicz " ]
1,588
1,589
1,589
CONTRIBUTOR
null
Problem: gpt2 model and other models using gelu_new or gelu_fast cannot be exported to valid ONNX model. Causes: PyTorch will export some constants like 1 or 2 as int64, while ONNX operators like [Add](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Add) and [Pow](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Pow) requires data type matches between two inputs. It is invalid to have one input as float and another as int64. For GPT2 model, another issue is the ONNX operator [Where](https://github.com/onnx/onnx/blob/master/docs/Operators.md#Where). It requires the first input to be bool tensor but currently it is uint8 tensor. Add explicit data type cast could solve these problems. It is verified in exporting 3 pretrained models to ONNX model and loading by ONNX Runtime: albert-base-v2, distilgpt2, gpt2.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4244/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4244/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4244", "html_url": "https://github.com/huggingface/transformers/pull/4244", "diff_url": "https://github.com/huggingface/transformers/pull/4244.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4244.patch", "merged_at": 1589223356000 }
https://api.github.com/repos/huggingface/transformers/issues/4243
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4243/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4243/comments
https://api.github.com/repos/huggingface/transformers/issues/4243/events
https://github.com/huggingface/transformers/pull/4243
615,048,944
MDExOlB1bGxSZXF1ZXN0NDE1NDgzNjM3
4,243
Distributed eval: SequentialDistributedSampler + gather all results
{ "login": "julien-c", "id": 326577, "node_id": "MDQ6VXNlcjMyNjU3Nw==", "avatar_url": "https://avatars.githubusercontent.com/u/326577?v=4", "gravatar_id": "", "url": "https://api.github.com/users/julien-c", "html_url": "https://github.com/julien-c", "followers_url": "https://api.github.com/users/julien-c/followers", "following_url": "https://api.github.com/users/julien-c/following{/other_user}", "gists_url": "https://api.github.com/users/julien-c/gists{/gist_id}", "starred_url": "https://api.github.com/users/julien-c/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/julien-c/subscriptions", "organizations_url": "https://api.github.com/users/julien-c/orgs", "repos_url": "https://api.github.com/users/julien-c/repos", "events_url": "https://api.github.com/users/julien-c/events{/privacy}", "received_events_url": "https://api.github.com/users/julien-c/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4243?src=pr&el=h1) Report\n> Merging [#4243](https://codecov.io/gh/huggingface/transformers/pull/4243?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/2d05480174c736399c212b3d60b8774fbbf2b6c2&el=desc) will **decrease** coverage by `0.13%`.\n> The diff coverage is `32.05%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4243/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4243?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4243 +/- ##\n==========================================\n- Coverage 78.15% 78.02% -0.14% \n==========================================\n Files 120 120 \n Lines 20053 20105 +52 \n==========================================\n+ Hits 15673 15686 +13 \n- Misses 4380 4419 +39 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4243?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [src/transformers/trainer.py](https://codecov.io/gh/huggingface/transformers/pull/4243/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmVyLnB5) | `39.67% <32.05%> (-1.78%)` | :arrow_down: |\n| [src/transformers/modeling\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4243/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `90.48% <0.00%> (-0.13%)` | :arrow_down: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4243?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4243?src=pr&el=footer). Last update [2d05480...3e32aea](https://codecov.io/gh/huggingface/transformers/pull/4243?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n" ]
1,588
1,589
1,589
MEMBER
null
As discussed in #3944 In our [**`Trainer`**](https://github.com/huggingface/transformers/blob/master/src/transformers/trainer.py), in torch.distributed mode, eval/predict are currently running on a single node. This PR attempts to fix this. This relies on: - a custom `DistributedSampler` named SequentialDistributedSampler that makes it easier to collate inference results at the end of the loop - some tricky code to gather numpy arrays back to a single node (or to all of them). I might be missing something simpler here. For instance in `pytorch/xla` there seems to be a [built-in function to do this](https://github.com/huggingface/transformers/blob/7b75aa9fa55bee577e2c7403301ed31103125a35/src/transformers/trainer.py#L656-L659). Please let me know if that's the case 😁
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4243/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4243/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4243", "html_url": "https://github.com/huggingface/transformers/pull/4243", "diff_url": "https://github.com/huggingface/transformers/pull/4243.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4243.patch", "merged_at": 1589853760000 }
https://api.github.com/repos/huggingface/transformers/issues/4242
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4242/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4242/comments
https://api.github.com/repos/huggingface/transformers/issues/4242/events
https://github.com/huggingface/transformers/pull/4242
614,926,172
MDExOlB1bGxSZXF1ZXN0NDE1MzgzNDIz
4,242
Reformer self attention mask value not converted in apex half precision
{ "login": "theblackcat102", "id": 13172147, "node_id": "MDQ6VXNlcjEzMTcyMTQ3", "avatar_url": "https://avatars.githubusercontent.com/u/13172147?v=4", "gravatar_id": "", "url": "https://api.github.com/users/theblackcat102", "html_url": "https://github.com/theblackcat102", "followers_url": "https://api.github.com/users/theblackcat102/followers", "following_url": "https://api.github.com/users/theblackcat102/following{/other_user}", "gists_url": "https://api.github.com/users/theblackcat102/gists{/gist_id}", "starred_url": "https://api.github.com/users/theblackcat102/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/theblackcat102/subscriptions", "organizations_url": "https://api.github.com/users/theblackcat102/orgs", "repos_url": "https://api.github.com/users/theblackcat102/repos", "events_url": "https://api.github.com/users/theblackcat102/events{/privacy}", "received_events_url": "https://api.github.com/users/theblackcat102/received_events", "type": "User", "site_admin": false }
[ { "id": 2052904485, "node_id": "MDU6TGFiZWwyMDUyOTA0NDg1", "url": "https://api.github.com/repos/huggingface/transformers/labels/reformer", "name": "reformer", "color": "5319e7", "default": false, "description": "Everything related to the reformer model" } ]
closed
false
{ "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false }
[ { "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false } ]
[ "# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4242?src=pr&el=h1) Report\n> Merging [#4242](https://codecov.io/gh/huggingface/transformers/pull/4242?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/7b75aa9fa55bee577e2c7403301ed31103125a35&el=desc) will **increase** coverage by `0.00%`.\n> The diff coverage is `0.00%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4242/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4242?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4242 +/- ##\n=======================================\n Coverage 78.39% 78.39% \n=======================================\n Files 120 120 \n Lines 19925 19925 \n=======================================\n+ Hits 15620 15621 +1 \n+ Misses 4305 4304 -1 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4242?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [src/transformers/modeling\\_reformer.py](https://codecov.io/gh/huggingface/transformers/pull/4242/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19yZWZvcm1lci5weQ==) | `88.17% <0.00%> (ø)` | |\n| [src/transformers/modeling\\_tf\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4242/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `92.93% <0.00%> (ø)` | |\n| [src/transformers/file\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4242/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `74.38% <0.00%> (+0.41%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4242?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4242?src=pr&el=footer). Last update [7b75aa9...a14259c](https://codecov.io/gh/huggingface/transformers/pull/4242?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n" ]
1,588
1,589
1,589
CONTRIBUTOR
null
# 🐛 Bug ## Information Model I am using Reformer: Language I am using the model on English: The problem arises when using: * [ x] my own modified scripts: (give details below) The tasks I am working on is: * [x ] my own task or dataset: (give details below) ## To reproduce Steps to reproduce the behavior: Install the latest transformers 2.9.0 and apex ``` from transformers import ReformerModel, ReformerTokenizer import torch from apex import amp tokenizer = ReformerTokenizer.from_pretrained('google/reformer-crime-and-punishment') model = ReformerModel.from_pretrained('google/reformer-crime-and-punishment').cuda() optimizer = torch.optim.Adam(model.parameters(), lr=0.0001) model, optimizer = amp.initialize(model, optimizer, opt_level='O1') input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute", add_special_tokens=True)).unsqueeze(0).cuda() # Batch size 1 outputs = model(input_ids) last_hidden_states = outputs[0] # The last hidden-state is the first element of the output tuple ``` ## Expected behavior ``` File "/home/model/env/lib/python3.7/site-packages/transformers/modeling_reformer.py", line 840, in forward query_key_dots = torch.where(mask, query_key_dots, mask_value) RuntimeError: expected scalar type Half but found Float ``` - `transformers` version: - Platform: Ubuntu 18.04 - Python version: 3.7 - PyTorch version (GPU?): 1.5.0 cuda - Tensorflow version (GPU?): No tensorflow - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4242/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4242/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4242", "html_url": "https://github.com/huggingface/transformers/pull/4242", "diff_url": "https://github.com/huggingface/transformers/pull/4242.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4242.patch", "merged_at": 1589208823000 }
https://api.github.com/repos/huggingface/transformers/issues/4241
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4241/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4241/comments
https://api.github.com/repos/huggingface/transformers/issues/4241/events
https://github.com/huggingface/transformers/issues/4241
614,925,412
MDU6SXNzdWU2MTQ5MjU0MTI=
4,241
Reformer self attention mask value not converted in apex half precision
{ "login": "theblackcat102", "id": 13172147, "node_id": "MDQ6VXNlcjEzMTcyMTQ3", "avatar_url": "https://avatars.githubusercontent.com/u/13172147?v=4", "gravatar_id": "", "url": "https://api.github.com/users/theblackcat102", "html_url": "https://github.com/theblackcat102", "followers_url": "https://api.github.com/users/theblackcat102/followers", "following_url": "https://api.github.com/users/theblackcat102/following{/other_user}", "gists_url": "https://api.github.com/users/theblackcat102/gists{/gist_id}", "starred_url": "https://api.github.com/users/theblackcat102/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/theblackcat102/subscriptions", "organizations_url": "https://api.github.com/users/theblackcat102/orgs", "repos_url": "https://api.github.com/users/theblackcat102/repos", "events_url": "https://api.github.com/users/theblackcat102/events{/privacy}", "received_events_url": "https://api.github.com/users/theblackcat102/received_events", "type": "User", "site_admin": false }
[ { "id": 2052904485, "node_id": "MDU6TGFiZWwyMDUyOTA0NDg1", "url": "https://api.github.com/repos/huggingface/transformers/labels/reformer", "name": "reformer", "color": "5319e7", "default": false, "description": "Everything related to the reformer model" } ]
closed
false
{ "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false }
[ { "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false } ]
[ "I have submitted a pull request in #4242 ", "Awesome I will take a look - thanks for the PR :-) " ]
1,588
1,589
1,589
CONTRIBUTOR
null
# 🐛 Bug ## Information Model I am using Reformer: Language I am using the model on English: The problem arises when using: * [ x] my own modified scripts: (give details below) The tasks I am working on is: * [x ] my own task or dataset: (give details below) ## To reproduce Steps to reproduce the behavior: Install the latest transformers 2.9.0 and apex ``` from transformers import ReformerModel, ReformerTokenizer import torch from apex import amp tokenizer = ReformerTokenizer.from_pretrained('google/reformer-crime-and-punishment') model = ReformerModel.from_pretrained('google/reformer-crime-and-punishment').cuda() optimizer = torch.optim.Adam(model.parameters(), lr=0.0001) model, optimizer = amp.initialize(model, optimizer, opt_level='O1') input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute", add_special_tokens=True)).unsqueeze(0).cuda() # Batch size 1 outputs = model(input_ids) last_hidden_states = outputs[0] # The last hidden-state is the first element of the output tuple ``` ## Expected behavior ``` File "/home/model/env/lib/python3.7/site-packages/transformers/modeling_reformer.py", line 840, in forward query_key_dots = torch.where(mask, query_key_dots, mask_value) RuntimeError: expected scalar type Half but found Float ``` - `transformers` version: 2.9.0 (latest source from github) - Platform: Ubuntu 18.04 - Python version: 3.7 - PyTorch version (GPU?): 1.5.0 cuda - Tensorflow version (GPU?): No tensorflow - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4241/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4241/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4240
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4240/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4240/comments
https://api.github.com/repos/huggingface/transformers/issues/4240/events
https://github.com/huggingface/transformers/issues/4240
614,914,937
MDU6SXNzdWU2MTQ5MTQ5Mzc=
4,240
RuntimeError: expected device cpu but got device cuda:0
{ "login": "zaowad", "id": 29595623, "node_id": "MDQ6VXNlcjI5NTk1NjIz", "avatar_url": "https://avatars.githubusercontent.com/u/29595623?v=4", "gravatar_id": "", "url": "https://api.github.com/users/zaowad", "html_url": "https://github.com/zaowad", "followers_url": "https://api.github.com/users/zaowad/followers", "following_url": "https://api.github.com/users/zaowad/following{/other_user}", "gists_url": "https://api.github.com/users/zaowad/gists{/gist_id}", "starred_url": "https://api.github.com/users/zaowad/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/zaowad/subscriptions", "organizations_url": "https://api.github.com/users/zaowad/orgs", "repos_url": "https://api.github.com/users/zaowad/repos", "events_url": "https://api.github.com/users/zaowad/events{/privacy}", "received_events_url": "https://api.github.com/users/zaowad/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "Try initialize the model in the trainer script from transformers with self.model = model.cuda()", "I am getting the same error. Is there work around ? \r\nWhat @tebandesade mentioned didnt work out for.", "I faced the same problem with RoBERTa pretraining, however inserting line model = model.cuda() before trainer in run_language_modeling.py file helped me\r\n@tebandesade, Thank you!\r\n", "Hello! I'm having trouble reproducing that on master. Do you mind installing from source and letting me know if you still have the issue? Thank you", "Hi @LysandreJik, installing from source doesn't fix the issue, though @tebandesade's suggestion works fine. \r\n\r\n@octalpixel try editing this line, it shall work;\r\nhttps://github.com/huggingface/transformers/blob/62427d0815825436fa55b43725f44776e94abb65/src/transformers/trainer.py#L145", "I am getting this error too.\r\n\r\nI think the issue is optimizers are [setup](https://github.com/huggingface/transformers/blob/3e0f06210646a440509efa718b30d18322d6a830/src/transformers/trainer.py#L242) from `self.model` which is in cpu, but the model is [moved to device](https://github.com/huggingface/transformers/blob/3e0f06210646a440509efa718b30d18322d6a830/src/transformers/trainer.py#L338) afterwards. Which is why `self.model = model.cuda()` fixes the error. \r\n", "Should be fixed on master thanks to @shaoyent . Give it a try and let us know:)", "> I am getting this error too.\r\n> \r\n> I think the issue is optimizers are [setup](https://github.com/huggingface/transformers/blob/3e0f06210646a440509efa718b30d18322d6a830/src/transformers/trainer.py#L242) from `self.model` which is in cpu, but the model is [moved to device](https://github.com/huggingface/transformers/blob/3e0f06210646a440509efa718b30d18322d6a830/src/transformers/trainer.py#L338) afterwards. Which is why `self.model = model.cuda()` fixes the error.\r\n\r\nIt works if you didn't install transformers package, or you will need to modify the installed package file." ]
1,588
1,590
1,589
NONE
null
I am traing a roberta model and running the script examples/run_language_modeling.py The following error occurs when i am trying to resume training. Traceback (most recent call last): File "examples/run_language_modeling.py", line 284, in <module> main() File "examples/run_language_modeling.py", line 254, in main trainer.train(model_path=model_path) File "/home/socian-pc1/anaconda3/envs/XformerEnv/lib/python3.6/site-packages/transformers/trainer.py", line 326, in train optimizer.step() File "/home/socian-pc1/anaconda3/envs/XformerEnv/lib/python3.6/site-packages/torch/optim/lr_scheduler.py", line 67, in wrapper return wrapped(*args, **kwargs) File "/home/socian-pc1/anaconda3/envs/XformerEnv/lib/python3.6/site-packages/transformers/optimization.py", line 155, in step exp_avg.mul_(beta1).add_(1.0 - beta1, grad) RuntimeError: expected device cpu but got device cuda:0 My config python examples/run_language_modeling.py \ --train_data_file $TRAIN_FILE \ --eval_data_file $TEST_FILE \ --output_dir ./MyRobertaOutput \ --model_name_or_path ./MyRoBERTa/checkpoint-570000 \ --config_name ../xformer_output \ --tokenizer_name ../xformer_output \ --mlm \ --do_train \ --do_eval \ --line_by_line \ --learning_rate 1e-5 \ --num_train_epochs 2 \ --save_total_limit 20 \ --save_steps 5000 \ --per_gpu_train_batch_size 6 \ --warmup_steps=10000 \ --logging_steps=100 \ --gradient_accumulation_steps=4 \ --seed 666 --block_size=512
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4240/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4240/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4239
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4239/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4239/comments
https://api.github.com/repos/huggingface/transformers/issues/4239/events
https://github.com/huggingface/transformers/issues/4239
614,909,295
MDU6SXNzdWU2MTQ5MDkyOTU=
4,239
distilbert-base-uncased
{ "login": "anitaj-j", "id": 24881797, "node_id": "MDQ6VXNlcjI0ODgxNzk3", "avatar_url": "https://avatars.githubusercontent.com/u/24881797?v=4", "gravatar_id": "", "url": "https://api.github.com/users/anitaj-j", "html_url": "https://github.com/anitaj-j", "followers_url": "https://api.github.com/users/anitaj-j/followers", "following_url": "https://api.github.com/users/anitaj-j/following{/other_user}", "gists_url": "https://api.github.com/users/anitaj-j/gists{/gist_id}", "starred_url": "https://api.github.com/users/anitaj-j/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/anitaj-j/subscriptions", "organizations_url": "https://api.github.com/users/anitaj-j/orgs", "repos_url": "https://api.github.com/users/anitaj-j/repos", "events_url": "https://api.github.com/users/anitaj-j/events{/privacy}", "received_events_url": "https://api.github.com/users/anitaj-j/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "hi! did you find a solution? I got the same problem!", "I have the same problem with a freshly installed version. Any ideas?", "This can happen if there is a network or firewall issue that prevents the `transformers` library from downloading the required files. To replicate on a laptop, you can delete the cache (e.g., `~/.cache/torch/transformers`), turn off wifi, and run this:\r\n```python\r\nfrom transformers import *\r\ntokenizer = DistilBertTokenizer.from_pretrained('distilbert-base-uncased')\r\n```\r\nIf following the above steps, you will see the exact same error as posted above (i.e., `OSError: Model name 'distilbert-base-uncased' was not found in tokenizers model name list `).\r\n\r\nAs a workaround for machines with download issues, you can download the tokenizer files (e.g., `vocab.txt`) and model files manually using machine with access, copy folder to machine with firewall/network issues, and then point `transformers` to the folder containing the downloaded files (e.g., `DistilBertTokenizer.from_pretrained('path/to/folder)`).\r\n\r\nSee [this ktrain FAQ entry](https://github.com/amaiya/ktrain/blob/master/FAQ.md#how-do-i-use-ktrain-without-an-internet-connection) for more information on workarounds/solutions on using `transformers` without internet or behind firewall. While the entry focuses on using `transformers` from within the *ktrain* library, most information applies generally to `transformers`.", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n", "This is resolved if you ensure you use transformers==3.4.0" ]
1,588
1,608
1,603
NONE
null
# 🐛 Bug/Question ## Information am trying to execute : **import ktrain from ktrain import text MODEL_NAME='distilbert-base-uncased' t=text.Transformer(MODEL_NAME, maxlen=500, classes=np.unique(y_train))** I get the following error: OSError: Model name 'distilbert-base-uncased' was not found in tokenizers model name list (distilbert-base-uncased, distilbert-base-uncased-distilled-squad, distilbert-base-cased, distilbert-base-cased-distilled-squad, distilbert-base-german-cased, distilbert-base-multilingual-cased). We assumed 'distilbert-base-uncased' was a path, a model identifier, or url to a directory containing vocabulary files named ['vocab.txt'] but couldn't find such vocabulary files at this path or url. ktrain version 0.14.6 transformers version 2.8.0 Libraries was installed using pip install. I am following the tutorial : https://towardsdatascience.com/text-classification-with-hugging-face-transformers-in-tensorflow-2-without-tears-ee50e4f3e7ed Any help would be appreciated.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4239/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4239/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4238
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4238/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4238/comments
https://api.github.com/repos/huggingface/transformers/issues/4238/events
https://github.com/huggingface/transformers/pull/4238
614,824,863
MDExOlB1bGxSZXF1ZXN0NDE1MzAwNzcz
4,238
[tests] make pipelines tests faster with smaller models
{ "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4238?src=pr&el=h1) Report\n> Merging [#4238](https://codecov.io/gh/huggingface/transformers/pull/4238?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/274d850d340c0004ee63627c88c433d0e55f5876&el=desc) will **increase** coverage by `0.79%`.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4238/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4238?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4238 +/- ##\n==========================================\n+ Coverage 77.54% 78.33% +0.79% \n==========================================\n Files 120 120 \n Lines 19918 19918 \n==========================================\n+ Hits 15445 15603 +158 \n+ Misses 4473 4315 -158 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4238?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [src/transformers/tokenization\\_xlnet.py](https://codecov.io/gh/huggingface/transformers/pull/4238/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90b2tlbml6YXRpb25feGxuZXQucHk=) | `90.09% <0.00%> (-3.61%)` | :arrow_down: |\n| [src/transformers/modeling\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4238/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `90.36% <0.00%> (-0.61%)` | :arrow_down: |\n| [src/transformers/pipelines.py](https://codecov.io/gh/huggingface/transformers/pull/4238/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9waXBlbGluZXMucHk=) | `76.17% <0.00%> (-0.20%)` | :arrow_down: |\n| [src/transformers/trainer.py](https://codecov.io/gh/huggingface/transformers/pull/4238/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmVyLnB5) | `40.17% <0.00%> (+0.58%)` | :arrow_up: |\n| [src/transformers/modeling\\_openai.py](https://codecov.io/gh/huggingface/transformers/pull/4238/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19vcGVuYWkucHk=) | `81.78% <0.00%> (+1.37%)` | :arrow_up: |\n| [src/transformers/modeling\\_xlnet.py](https://codecov.io/gh/huggingface/transformers/pull/4238/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ194bG5ldC5weQ==) | `75.73% <0.00%> (+2.29%)` | :arrow_up: |\n| [src/transformers/modeling\\_ctrl.py](https://codecov.io/gh/huggingface/transformers/pull/4238/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19jdHJsLnB5) | `97.81% <0.00%> (+2.62%)` | :arrow_up: |\n| [src/transformers/modeling\\_roberta.py](https://codecov.io/gh/huggingface/transformers/pull/4238/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ19yb2JlcnRhLnB5) | `95.71% <0.00%> (+10.00%)` | :arrow_up: |\n| [src/transformers/modeling\\_tf\\_pytorch\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4238/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl9weXRvcmNoX3V0aWxzLnB5) | `89.93% <0.00%> (+81.20%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4238?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4238?src=pr&el=footer). Last update [274d850...4196a86](https://codecov.io/gh/huggingface/transformers/pull/4238?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "Looks good to me!", "please wait before merging, I'd like to take a look", "Yes, @julien-c I will keep all the old integration test logic in @slow.\r\n", "(Feel free to merge when this is done)" ]
1,588
1,589
1,589
CONTRIBUTOR
null
- speedup: 8mins -> 90s on 1 CPU - besides `test_fill_mask` the removed coverage was not meaningful, only shapes were being checked. - Would be happy to continue for TF or get help. - could use these in some examples tests also.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4238/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4238/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4238", "html_url": "https://github.com/huggingface/transformers/pull/4238", "diff_url": "https://github.com/huggingface/transformers/pull/4238.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4238.patch", "merged_at": 1589477762000 }
https://api.github.com/repos/huggingface/transformers/issues/4237
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4237/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4237/comments
https://api.github.com/repos/huggingface/transformers/issues/4237/events
https://github.com/huggingface/transformers/issues/4237
614,788,550
MDU6SXNzdWU2MTQ3ODg1NTA=
4,237
Only self-attention returned when output_attentions = True for BERT
{ "login": "YovaKem", "id": 29899597, "node_id": "MDQ6VXNlcjI5ODk5NTk3", "avatar_url": "https://avatars.githubusercontent.com/u/29899597?v=4", "gravatar_id": "", "url": "https://api.github.com/users/YovaKem", "html_url": "https://github.com/YovaKem", "followers_url": "https://api.github.com/users/YovaKem/followers", "following_url": "https://api.github.com/users/YovaKem/following{/other_user}", "gists_url": "https://api.github.com/users/YovaKem/gists{/gist_id}", "starred_url": "https://api.github.com/users/YovaKem/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/YovaKem/subscriptions", "organizations_url": "https://api.github.com/users/YovaKem/orgs", "repos_url": "https://api.github.com/users/YovaKem/repos", "events_url": "https://api.github.com/users/YovaKem/events{/privacy}", "received_events_url": "https://api.github.com/users/YovaKem/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,588
1,594
1,594
NONE
null
# 🐛 Bug ``` if self.output_attentions: all_attentions = all_attentions + (layer_outputs[1],) ``` should be ``` if self.output_attentions: all_attentions = all_attentions + (layer_outputs[1:],) ``` ## Information Line 412 [here](https://github.com/huggingface/transformers/blob/master/src/transformers/modeling_bert.py ) I assume that there is no reason to exclude cross-attention from all_attentions.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4237/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4237/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4236
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4236/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4236/comments
https://api.github.com/repos/huggingface/transformers/issues/4236/events
https://github.com/huggingface/transformers/pull/4236
614,778,455
MDExOlB1bGxSZXF1ZXN0NDE1MjYzNjE1
4,236
Pipelines: use tokenizer.max_len
{ "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4236?src=pr&el=h1) Report\n> Merging [#4236](https://codecov.io/gh/huggingface/transformers/pull/4236?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/cf08830c2868c5335b1657f95779f370862e3a28&el=desc) will **decrease** coverage by `0.01%`.\n> The diff coverage is `n/a`.\n\n[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4236/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4236?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4236 +/- ##\n==========================================\n- Coverage 78.38% 78.37% -0.02% \n==========================================\n Files 120 120 \n Lines 19918 19918 \n==========================================\n- Hits 15613 15611 -2 \n- Misses 4305 4307 +2 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4236?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [src/transformers/pipelines.py](https://codecov.io/gh/huggingface/transformers/pull/4236/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9waXBlbGluZXMucHk=) | `76.56% <ø> (+0.19%)` | :arrow_up: |\n| [src/transformers/modeling\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4236/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `90.48% <0.00%> (-0.49%)` | :arrow_down: |\n| [src/transformers/modeling\\_tf\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4236/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `92.93% <0.00%> (+0.16%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4236?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4236?src=pr&el=footer). Last update [cf08830...158cd06](https://codecov.io/gh/huggingface/transformers/pull/4236?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "This PR is actually very related to this issue: #4501", "Abandoning." ]
1,588
1,592
1,592
CONTRIBUTOR
null
fix #4224 by passing tokenizer.max_len to `tokenizer.batch_encode_plus`
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4236/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4236/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4236", "html_url": "https://github.com/huggingface/transformers/pull/4236", "diff_url": "https://github.com/huggingface/transformers/pull/4236.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4236.patch", "merged_at": null }
https://api.github.com/repos/huggingface/transformers/issues/4235
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4235/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4235/comments
https://api.github.com/repos/huggingface/transformers/issues/4235/events
https://github.com/huggingface/transformers/issues/4235
614,768,404
MDU6SXNzdWU2MTQ3Njg0MDQ=
4,235
Error importing Reformer model
{ "login": "bayomim", "id": 5493593, "node_id": "MDQ6VXNlcjU0OTM1OTM=", "avatar_url": "https://avatars.githubusercontent.com/u/5493593?v=4", "gravatar_id": "", "url": "https://api.github.com/users/bayomim", "html_url": "https://github.com/bayomim", "followers_url": "https://api.github.com/users/bayomim/followers", "following_url": "https://api.github.com/users/bayomim/following{/other_user}", "gists_url": "https://api.github.com/users/bayomim/gists{/gist_id}", "starred_url": "https://api.github.com/users/bayomim/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bayomim/subscriptions", "organizations_url": "https://api.github.com/users/bayomim/orgs", "repos_url": "https://api.github.com/users/bayomim/repos", "events_url": "https://api.github.com/users/bayomim/events{/privacy}", "received_events_url": "https://api.github.com/users/bayomim/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "I think you only need to update the library.\r\nVersion 2.9, released esterday, contains the reformer model", "Thanks, \r\nInstalling Version 2.9.0 solved the issue" ]
1,588
1,589
1,589
NONE
null
# 🐛 Bug ## Information I am trying to import the Reformer model as in here: https://huggingface.co/transformers/model_doc/reformer.html ''' from transformers import ReformerModel, ReformerConfig ''' However, I am getting the following error: ImportError: cannot import name 'ReformerModel' from 'transformers' The problem arises when using: * [ √] the official example scripts: (give details below) * [ X ] my own modified scripts: (give details below) - `transformers` version: 2.8.0
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4235/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4235/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4234
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4234/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4234/comments
https://api.github.com/repos/huggingface/transformers/issues/4234/events
https://github.com/huggingface/transformers/issues/4234
614,767,184
MDU6SXNzdWU2MTQ3NjcxODQ=
4,234
[infra] make a tiny "distilroberta-base" to speed up test_pipelines.py and test_examples.py
{ "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false }
[ { "id": 1990918270, "node_id": "MDU6TGFiZWwxOTkwOTE4Mjcw", "url": "https://api.github.com/repos/huggingface/transformers/labels/Good%20First%20Issue", "name": "Good First Issue", "color": "bbf794", "default": false, "description": "" } ]
closed
false
{ "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false }
[ { "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false } ]
[]
1,588
1,589
1,589
CONTRIBUTOR
null
put it in a user namespace on s3 like `sshleifer/tiny-distilroberta` doing the same for distilbert-base would probably also help.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4234/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4234/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4233
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4233/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4233/comments
https://api.github.com/repos/huggingface/transformers/issues/4233/events
https://github.com/huggingface/transformers/issues/4233
614,762,177
MDU6SXNzdWU2MTQ3NjIxNzc=
4,233
How can I mute the info from BertTokenizerFast.encode_plus
{ "login": "131250208", "id": 7437595, "node_id": "MDQ6VXNlcjc0Mzc1OTU=", "avatar_url": "https://avatars.githubusercontent.com/u/7437595?v=4", "gravatar_id": "", "url": "https://api.github.com/users/131250208", "html_url": "https://github.com/131250208", "followers_url": "https://api.github.com/users/131250208/followers", "following_url": "https://api.github.com/users/131250208/following{/other_user}", "gists_url": "https://api.github.com/users/131250208/gists{/gist_id}", "starred_url": "https://api.github.com/users/131250208/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/131250208/subscriptions", "organizations_url": "https://api.github.com/users/131250208/orgs", "repos_url": "https://api.github.com/users/131250208/repos", "events_url": "https://api.github.com/users/131250208/events{/privacy}", "received_events_url": "https://api.github.com/users/131250208/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,588
1,594
1,594
NONE
null
# 🐛 Bug ## Information Model I am using: Bert Language I am using the model on (English, Chinese ...): Chinese The problem arises when using: * [ ] the official example scripts: (give details below) * [ ] my own modified scripts: (give details below) ```python tokenizer.encode_plus(...) ``` Every time I run this line, the info "Fast tokenizers add special tokens by default. To remove special tokens, please specify`add_special_tokens=False` during the initialisation rather than when calling `encode`,`encode_plus` or `batch_encode_plus`." will come out. Even though I have already set the add_special_tokens to False ```python tokenizer = BertTokenizerFast.from_pretrained(model_path, add_special_tokens = False) ``` The info can be very annoying when I run an iteration loop. How can I mute this info. ## Environment info - `transformers` version: 2.8.0 - Platform: Linux-4.4.0-87-generic-x86_64-with-debian-stretch-sid - Python version: 3.6.9 - PyTorch version (GPU?): 1.4.0+cu100 (True) - Tensorflow version (GPU?): 2.0.0 (True) - Using GPU in script?: yes - Using distributed or parallel set-up in script?: no
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4233/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4233/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4232
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4232/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4232/comments
https://api.github.com/repos/huggingface/transformers/issues/4232/events
https://github.com/huggingface/transformers/issues/4232
614,733,144
MDU6SXNzdWU2MTQ3MzMxNDQ=
4,232
MarianMTModel: Runtime Errors
{ "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false }
[ { "id": 2039044877, "node_id": "MDU6TGFiZWwyMDM5MDQ0ODc3", "url": "https://api.github.com/repos/huggingface/transformers/labels/marian", "name": "marian", "color": "30cc95", "default": false, "description": "" } ]
closed
false
{ "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false }
[ { "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false } ]
[ "Fixed on S3.\r\n" ]
1,588
1,588
1,588
CONTRIBUTOR
null
11/1010 models cannot me loaded because of state_dict mismatches (not tokenizer). ```python failing = ['sv-tpi', 'fi-en', 'sv-ty', 'sv-toi', 'en-st', 'en-tl', 'sv-ts', 'sv-tvl', 'en-fi', 'en-ml', 'fi-sv'] for mname in failing: slug = f'opus-mt-{mname}' MarianMTModel.from_pretrained(slug) ``` `en-st` is a slightly different error: ``` 'Unable to load vocabulary from file. Please check that the provided vocabulary is accessible and not corrupted.'), ```
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4232/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4232/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4231
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4231/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4231/comments
https://api.github.com/repos/huggingface/transformers/issues/4231/events
https://github.com/huggingface/transformers/issues/4231
614,704,731
MDU6SXNzdWU2MTQ3MDQ3MzE=
4,231
Strange difference between NER results in 2.8.0 and previous versions
{ "login": "pvcastro", "id": 12713359, "node_id": "MDQ6VXNlcjEyNzEzMzU5", "avatar_url": "https://avatars.githubusercontent.com/u/12713359?v=4", "gravatar_id": "", "url": "https://api.github.com/users/pvcastro", "html_url": "https://github.com/pvcastro", "followers_url": "https://api.github.com/users/pvcastro/followers", "following_url": "https://api.github.com/users/pvcastro/following{/other_user}", "gists_url": "https://api.github.com/users/pvcastro/gists{/gist_id}", "starred_url": "https://api.github.com/users/pvcastro/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pvcastro/subscriptions", "organizations_url": "https://api.github.com/users/pvcastro/orgs", "repos_url": "https://api.github.com/users/pvcastro/repos", "events_url": "https://api.github.com/users/pvcastro/events{/privacy}", "received_events_url": "https://api.github.com/users/pvcastro/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
{ "login": "stefan-it", "id": 20651387, "node_id": "MDQ6VXNlcjIwNjUxMzg3", "avatar_url": "https://avatars.githubusercontent.com/u/20651387?v=4", "gravatar_id": "", "url": "https://api.github.com/users/stefan-it", "html_url": "https://github.com/stefan-it", "followers_url": "https://api.github.com/users/stefan-it/followers", "following_url": "https://api.github.com/users/stefan-it/following{/other_user}", "gists_url": "https://api.github.com/users/stefan-it/gists{/gist_id}", "starred_url": "https://api.github.com/users/stefan-it/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stefan-it/subscriptions", "organizations_url": "https://api.github.com/users/stefan-it/orgs", "repos_url": "https://api.github.com/users/stefan-it/repos", "events_url": "https://api.github.com/users/stefan-it/events{/privacy}", "received_events_url": "https://api.github.com/users/stefan-it/received_events", "type": "User", "site_admin": false }
[ { "login": "stefan-it", "id": 20651387, "node_id": "MDQ6VXNlcjIwNjUxMzg3", "avatar_url": "https://avatars.githubusercontent.com/u/20651387?v=4", "gravatar_id": "", "url": "https://api.github.com/users/stefan-it", "html_url": "https://github.com/stefan-it", "followers_url": "https://api.github.com/users/stefan-it/followers", "following_url": "https://api.github.com/users/stefan-it/following{/other_user}", "gists_url": "https://api.github.com/users/stefan-it/gists{/gist_id}", "starred_url": "https://api.github.com/users/stefan-it/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/stefan-it/subscriptions", "organizations_url": "https://api.github.com/users/stefan-it/orgs", "repos_url": "https://api.github.com/users/stefan-it/repos", "events_url": "https://api.github.com/users/stefan-it/events{/privacy}", "received_events_url": "https://api.github.com/users/stefan-it/received_events", "type": "User", "site_admin": false } ]
[ "FYI, ran in 2.9.0 as well and got the same results.", "Hi @pvcastro , so the CoNLL results are looking good 🤔 Because there's an improviment with 2.8.\r\n\r\nRegarding to HAREM: Could you verify that there's a `tokenizer_config.json` located in the `/home/models/albert/base_pt_brwac_en/albert_ckp_1176k` folder? Is it an uncased or cased model?", "Hi @stefan-it !\r\nThere's an improvement for CoNLL, but does this improvement make sense? Shouldn't the results be closer to each other?\r\n\r\nAs for HAREM, there's a tokenizer_config.json, but it's empty...there are only the {}. The model is **cased**.", "Could you use the following `tokenizer_config.json`:\r\n\r\n```json\r\n{\"do_lower_case\": false, \"max_len\": 512, \"init_inputs\": [], \"strip_accents\":false}\r\n```\r\n\r\nBy default ALBERT models are lower-cased (if you don't specify it in that configuration):\r\n\r\nhttps://github.com/huggingface/transformers/blob/26dad0a9fab0694ce1128d91838b9ca78e1554f6/src/transformers/tokenization_albert.py#L117\r\n\r\n(Because the original ALBERT model is an uncased model).\r\n\r\nThen please re-run the experiment (and also clear the `cached_*` files in your data folder/examples folder) - this should hopefully improve performance :)", "Oh I see @stefan-it , it worked! Got 80.55 for HAREM doing this. So the reason this happened after the version change it's because before, the do_lower_case was passed as default from run_ner.py as False, and now this doesn't happen in 2.8.0 anymore. And for CoNLL the effect was the opposite...should be setting --do_lower_case for 2.7.0, since the default for this version is False and the model is uncased. \r\nThanks!", "Hi @stefan-it !\r\nIf you don't mind me asking this in this closed issue, now I'm facing the same problem concerning a portuguese electra model I'm benchmarking. \r\n\r\nI did what you suggested for ALBERT model, and for ELECTRA I'm doing the same thing...I create a tokenizer_config.json doing the same thing. However, for ELECTRA I'm getting a huge difference between the NER models trained using transformers 2.9.1 (happened with 2.7.0 and 2.8.0 too) and the ones trained with the chunk task in electra's original repository. \r\n\r\nThis is what I'm running there as parameter:\r\n\r\n`python /home/repositorios/electra/run_finetuning.py --data-dir /home/models/electra/electra_pt_small_pp_uncased_512/electra_ckp_100k/ner/harem/selective/electra_pt_small_pp_uncased_512 --model-name electra_pt_small_pp_uncased_512 --hparams {\"task_names\": [\"chunk\"], \"model_size\": \"small\", \"max_seq_length\": 512, \"learning_rate\": 3e-4, \"num_train_epochs\": 6, \"train_batch_size\": 32, \"do_lower_case\": true}`\r\n\r\nAnd this is what I use for transformers:\r\n\r\n`python /home/repositorios/transformers/examples/token-classification/run_ner.py --model_type electra --model_name_or_path /home/models/electra/electra_pt_small_pp_uncased_512/electra_ckp_100k --do_train --do_eval --do_predict --data_dir /home/corpora/ner/harem/selective --labels /home/corpora/ner/harem/selective/labels.txt --num_train_epochs 6 --per_gpu_train_batch_size 32 --per_gpu_eval_batch_size 32 --max_seq_length 512 --output_dir /home/models/electra/electra_pt_small_pp_uncased_512/electra_ckp_100k/ner/harem/selective --evaluate_during_training --save_steps 1000 --logging_steps 1000 --overwrite_output_dir --overwrite_cache`\r\n\r\nThis is the tokenizer_config.json used for this checkpoint:\r\n\r\n`{\"do_lower_case\": true, \"max_len\": 512, \"init_inputs\": [], \"strip_accents\":false}`\r\n\r\nThis is what I do to convert the electra tf checkpoint to pytorch:\r\n\r\n`python ${REPO_DIR}/src/transformers/convert_electra_original_tf_checkpoint_to_pytorch.py --tf_checkpoint_path ${CKP_DIR} --pytorch_dump_path ${CKP_DIR}/pytorch_model.bin --discriminator_or_generator discriminator --config_file ${CKP_DIR}/config.json`\r\n\r\nI use the very same electra config.json for both.\r\n\r\nFor this same checkpoint and parameters above, I get 36,33% using transformers and 71.42% using the electra repository. Do you know anything I should be doing differently? ", "Hi @pvcastro \r\n\r\nfor an uncased model the convention is to use the \"strip accents\" feature, so please try to set `strip_accents\": true` in your tokenizer config. Hopefully this solves the problem :)", "Hi @stefan-it , thanks for the response!\r\n\r\nI changed this single property in my tokenizer_config.json as you suggested, but made no difference. Got the exact same results :thinking: ", "Just to be clear, I'm using overwrite-output-dir and overwrite-cache to make sure that I'm not using any old files, and the tokenizer_config.json in the output-dir is updated with strip_accents true.", "That's really strange. Could you also set the same learning rate as in the ELECTRA example (Transformers uses 5e-5 as default).\r\n\r\nI had a look at the ELECTRA fine-tuning example a while ago -> I did implement an own evaluation class that uses `seqeval` like in Transformers. The results were a bit different between `seqeval` and ELECTRA evaluation output, but definitely not ~35%!", "Oh, that helped a lot. Now it went to 65.41%. Do you think the remaining difference is due to the evaluation differences?\r\n\r\nStrange that for english CoNLL 2003 you're able to get good results using the standard 5e-5 learning rate, right?", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,588
1,596
1,596
NONE
null
# 🐛 Bug ## Information Model I am using: Albert Language I am using the model on: English and Portuguese The problem arises when using: * [ ] the official example scripts: (give details below) The tasks I am working on is: * [ ] my own task or dataset: (give details below) ## To reproduce Not sure if this is a bug, but for the same seed and hyperparameters, I'm getting quite different results for different benchmarks on transformers 2.8.0 and 2.7.0. Steps to reproduce the behavior: 1. For 2.7.0: `python examples/ner/run_ner.py --data_dir <data-dir> --labels <labels-path> --model_type albert --model_name_or_path <albert-model> --output_dir <output-dir> --max_seq_length 512 --overwrite_output_dir --do_train --do_eval --do_predict --per_gpu_train_batch_size 16 --per_gpu_eval_batch_size 8 --learning_rate 5e-05 --num_train_epochs 5 --save_steps 878 --seed 1` 2. For 2.8.0: `python examples/ner/run_ner.py config.json`. Here's the config file for each: 2.1. For CoNLL: ``` { "data_dir": "/home/corpora/ner/conll2003", "labels": "/home/corpora/ner/conll2003/labels.txt", "model_name_or_path": "albert-base-v2", "output_dir": "/home/models/albert/conll2003", "max_seq_length": 512, "num_train_epochs": 5, "per_gpu_train_batch_size": 16, "save_steps": 878, "seed": 1, "do_train": true, "do_eval": true, "do_predict": true, "overwrite_output_dir": true } ``` 2.2. For HAREM: ``` { "data_dir": "/home/corpora/ner/harem/selective", "labels": "/home/corpora/ner/harem/selective/labels.txt", "model_name_or_path": "/home/models/albert/base_pt_brwac_en/albert_ckp_1176k", "output_dir": "/home/models/albert/base_pt_brwac_en/albert_ckp_1176k/harem", "max_seq_length": 512, "num_train_epochs": 5, "per_gpu_train_batch_size": 16, "save_steps": 878, "seed": 1, "do_train": true, "do_eval": true, "do_predict": true, "overwrite_output_dir": true } ``` 3. For English CoNLL-2003 used albert-base-v2, and for Portuguese HAREM used a checkpoint for a version we're training. <!-- If you have code snippets, error messages, stack traces please provide them here as well. Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.--> ## Expected behavior Following are the results I'm getting for each of the 4 runs. I think the results should be a lot closer to each other, considering the same hyperparameters and seeds are being used, right? 1. 2.7.0 / CoNLL-2003: ``` INFO - __main__ - Training/evaluation parameters Namespace(adam_epsilon=1e-08, cache_dir='', config_name='', data_dir='/home/corpora/ner/conll2003', device=device(type='cuda'), do_eval=True, do_lower_case=False, do_predict=True, do_train=True, eval_all_checkpoints=False, evaluate_during_training=False, fp16=False, fp16_opt_level='O1', gradient_accumulation_steps=1, keep_accents=None, labels='/home/corpora/ner/conll2003/labels.txt', learning_rate=5e-05, local_rank=-1, logging_steps=500, max_grad_norm=1.0, max_seq_length=512, max_steps=-1, model_name_or_path='albert-base-v2', model_type='albert', n_gpu=1, no_cuda=False, num_train_epochs=5.0, output_dir='/home/models/albert/conll2003-2.7.0', overwrite_cache=False, overwrite_output_dir=True, per_gpu_eval_batch_size=8, per_gpu_train_batch_size=16, save_steps=878, seed=1, server_ip='', server_port='', strip_accents=None, tokenizer_name='', use_fast=None, warmup_steps=0, weight_decay=0.0) INFO - __main__ - f1 = 0.8424940638466273 INFO - __main__ - loss = 0.184873234364002 INFO - __main__ - precision = 0.836973615236764 INFO - __main__ - recall = 0.8480878186968839 ``` 2. 2.8.0 / CoNLL-2003: ``` INFO - __main__ - Training/evaluation parameters TrainingArguments(output_dir='/home/models/albert/conll2003', overwrite_output_dir=True, do_train=True, do_eval=True, do_predict=True, evaluate_during_training=False, per_gpu_train_batch_size=16, per_gpu_eval_batch_size=8, gradient_accumulation_steps=1, learning_rate=5e-05, weight_decay=0.0, adam_epsilon=1e-08, max_grad_norm=1.0, num_train_epochs=5, max_steps=-1, warmup_steps=0, logging_dir=None, logging_first_step=False, logging_steps=500, save_steps=878, save_total_limit=None, no_cuda=False, seed=1, fp16=False, fp16_opt_level='O1', local_rank=-1) INFO - __main__ - precision = 0.890553401480437 INFO - __main__ - recall = 0.8946529745042493 INFO - __main__ - f1 = 0.892598480833775 INFO - __main__ - loss = 0.15480460636704224 ``` 3. 2.7.0 / HAREM ``` INFO - __main__ - Training/evaluation parameters Namespace(adam_epsilon=1e-08, cache_dir='', config_name='', data_dir='/home/corpora/ner/harem/selective', device=device(type='cuda'), do_eval=True, do_lower_case=False, do_predict=True, do_train=True, eval_all_checkpoints=False, evaluate_during_training=False, fp16=False, fp16_opt_level='O1', gradient_accumulation_steps=1, keep_accents=None, labels='/home/corpora/ner/harem/selective/labels.txt', learning_rate=5e-05, local_rank=-1, logging_steps=500, max_grad_norm=1.0, max_seq_length=512, max_steps=-1, model_name_or_path='albert-base-v2', model_type='albert', n_gpu=1, no_cuda=False, num_train_epochs=5.0, output_dir='/home/models/albert/eduardo/base_pt_brwac_en/albert_ckp_1176k/harem-2.7.0', overwrite_cache=False, overwrite_output_dir=True, per_gpu_eval_batch_size=8, per_gpu_train_batch_size=16, save_steps=878, seed=1, server_ip='', server_port='', strip_accents=None, tokenizer_name='', use_fast=None, warmup_steps=0, weight_decay=0.0) INFO - __main__ - f1 = 0.805560264451602 INFO - __main__ - loss = 0.11168152010335869 INFO - __main__ - precision = 0.8184636582845333 INFO - __main__ - recall = 0.7930574098798397 ``` 4. 2.8.0 / HAREM ``` INFO - __main__ - Training/evaluation parameters TrainingArguments(output_dir='/home/models/albert/eduardo/base_pt_brwac_en/albert_ckp_1176k/harem', overwrite_output_dir=True, do_train=True, do_eval=True, do_predict=True, evaluate_during_training=False, per_gpu_train_batch_size=16, per_gpu_eval_batch_size=8, gradient_accumulation_steps=1, learning_rate=5e-05, weight_decay=0.0, adam_epsilon=1e-08, max_grad_norm=1.0, num_train_epochs=5, max_steps=-1, warmup_steps=0, logging_dir=None, logging_first_step=False, logging_steps=500, save_steps=878, save_total_limit=None, no_cuda=False, seed=1, fp16=False, fp16_opt_level='O1', local_rank=-1) INFO - __main__ - precision = 0.7228915662650602 INFO - __main__ - recall = 0.7209612817089452 INFO - __main__ - f1 = 0.7219251336898397 INFO - __main__ - loss = 0.14575799524457683 ``` ## Environment info <!-- You can run the command `transformers-cli env` and copy-and-paste its output below. Don't forget to fill out the missing fields in that output! --> - `transformers` version: 2.8.0 - Platform: Linux-4.15.0-99-generic-x86_64-with-debian-stretch-sid - Python version: 3.7.5 - PyTorch version (GPU?): 1.3.1 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, Tesla V100-SXM2 - Using distributed or parallel set-up in script?: No
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4231/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4231/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4230
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4230/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4230/comments
https://api.github.com/repos/huggingface/transformers/issues/4230/events
https://github.com/huggingface/transformers/pull/4230
614,683,612
MDExOlB1bGxSZXF1ZXN0NDE1MTg3Mzgw
4,230
example updated to use generation pipeline
{ "login": "LoreDema", "id": 7656158, "node_id": "MDQ6VXNlcjc2NTYxNTg=", "avatar_url": "https://avatars.githubusercontent.com/u/7656158?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LoreDema", "html_url": "https://github.com/LoreDema", "followers_url": "https://api.github.com/users/LoreDema/followers", "following_url": "https://api.github.com/users/LoreDema/following{/other_user}", "gists_url": "https://api.github.com/users/LoreDema/gists{/gist_id}", "starred_url": "https://api.github.com/users/LoreDema/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LoreDema/subscriptions", "organizations_url": "https://api.github.com/users/LoreDema/orgs", "repos_url": "https://api.github.com/users/LoreDema/repos", "events_url": "https://api.github.com/users/LoreDema/events{/privacy}", "received_events_url": "https://api.github.com/users/LoreDema/received_events", "type": "User", "site_admin": false }
[ { "id": 1838412367, "node_id": "MDU6TGFiZWwxODM4NDEyMzY3", "url": "https://api.github.com/repos/huggingface/transformers/labels/model%20card", "name": "model card", "color": "92d5f4", "default": false, "description": "Related to pretrained model cards" } ]
closed
false
null
[]
[ "That's great, thanks! cc @patrickvonplaten for the text-generation pipeline" ]
1,588
1,588
1,588
CONTRIBUTOR
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4230/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4230/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4230", "html_url": "https://github.com/huggingface/transformers/pull/4230", "diff_url": "https://github.com/huggingface/transformers/pull/4230.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4230.patch", "merged_at": 1588945510000 }
https://api.github.com/repos/huggingface/transformers/issues/4229
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4229/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4229/comments
https://api.github.com/repos/huggingface/transformers/issues/4229/events
https://github.com/huggingface/transformers/issues/4229
614,660,602
MDU6SXNzdWU2MTQ2NjA2MDI=
4,229
Problem with BertTokenizer using additional_special_tokens
{ "login": "pvcastro", "id": 12713359, "node_id": "MDQ6VXNlcjEyNzEzMzU5", "avatar_url": "https://avatars.githubusercontent.com/u/12713359?v=4", "gravatar_id": "", "url": "https://api.github.com/users/pvcastro", "html_url": "https://github.com/pvcastro", "followers_url": "https://api.github.com/users/pvcastro/followers", "following_url": "https://api.github.com/users/pvcastro/following{/other_user}", "gists_url": "https://api.github.com/users/pvcastro/gists{/gist_id}", "starred_url": "https://api.github.com/users/pvcastro/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pvcastro/subscriptions", "organizations_url": "https://api.github.com/users/pvcastro/orgs", "repos_url": "https://api.github.com/users/pvcastro/repos", "events_url": "https://api.github.com/users/pvcastro/events{/privacy}", "received_events_url": "https://api.github.com/users/pvcastro/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "I've also confronted this issue. \r\nIn my case, with `transformers v2.8.0` it correctly splits special token. \r\nBut from `v2.9.0`, it splits the special tokens like `'[', 'e', '##11', ']'`. It's quite weird...", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,588
1,595
1,595
NONE
null
# 🐛 Bug ## Information Model I am using: Bert (bert-base-uncased) Language I am using the model on: English The problem arises when using: * [ ] the official example scripts: (give details below) The tasks I am working on is: * [ ] my own task or dataset: (give details below) ## To reproduce Steps to reproduce the behavior: 1. import transformers 2. from transformers import BertTokenizer 3. specify additional_special_tokens as ["[E11]", "[E12]", "[E21]", "[E22]"] 4. instantiate tokenizer as `tokenizer = BertTokenizer.from_pretrained('bert-base-uncased', do_lower_case=True, additional_special_tokens=additional_special_tokens)` 5. tokenize test string with the special tokens `'[E11] Tom Thabane [E12] resigned in October last year to form the [E21] All Basotho Convention [E22] -LRB- ABC -RRB- , crossing the floor with 17 members of parliament , causing constitutional monarch King Letsie III to dissolve parliament and call the snap election .'` using `tokenizer.tokenize(test_string)` <!-- If you have code snippets, error messages, stack traces please provide them here as well. Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.--> ## Expected behavior I would expect that the tokenization would give me regular tokens from wordpiece and the special tokens would be kept intact as [E11], [E12], etc, but instead I get: `['[', 'e', '##11', ']', 'tom', 'tha', '##bane', '[', 'e', '##12', ']', 'resigned', 'in', 'october', 'last', 'year', 'to', 'form', 'the', '[', 'e', '##21', ']', 'all', 'bas', '##otho', 'convention', '[', 'e', '##22', ']', '-', 'l', '##rb', '-', 'abc', '-', 'rr', '##b', '-', ',', 'crossing', 'the', 'floor', 'with', '17', 'members', 'of', 'parliament', ',', 'causing', 'constitutional', 'monarch', 'king', 'lets', '##ie', 'iii', 'to', 'dissolve', 'parliament', 'and', 'call', 'the', 'snap', 'election', '.']` I'm trying to run a training from [https://github.com/mickeystroller/R-BERT](https://github.com/mickeystroller/R-BERT), and reported this to the author, but he seems to get the proper results, even though we're both using transformers 2.8.0: His results: ![image](https://user-images.githubusercontent.com/12713359/81397632-1b293600-90fe-11ea-8d91-a7af43aeabae.png) My results: ![image](https://user-images.githubusercontent.com/12713359/81397653-241a0780-90fe-11ea-9ba6-1d86c2435dfd.png) ## Environment info <!-- You can run the command `transformers-cli env` and copy-and-paste its output below. Don't forget to fill out the missing fields in that output! --> - `transformers` version: 2.8.0 - Platform: Linux-4.15.0-99-generic-x86_64-with-debian-stretch-sid - Python version: 3.7.5 - PyTorch version (GPU?): 1.3.1 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: yes, GTX 1070 with CUDA 10.1.243 - Using distributed or parallel set-up in script?: No Here's the output from R-BERT's author as well: - `transformers` version: 2.8.0 - Platform: Linux-4.15.0-72-generic-x86_64-with-debian-buster-sid - Python version: 3.7.4 - PyTorch version (GPU?): 1.4.0 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: No - Using distributed or parallel set-up in script?: No The author from R-BERT seems to be using `tokenizers version 0.5.2`, and mine is 0.7.0. I tried downgrading mine to 0.5.2 to see if I would get the same results he did, but this doesn't seem to work because it's not compatible with transformers 2.8.0, as can be seen below. I have no Idea how he was able to use both together: ``` --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-1-514ca6d60059> in <module> ----> 1 import transformers 2 from transformers import BertTokenizer /media/discoD/anaconda3/envs/fast-bert/lib/python3.7/site-packages/transformers/__init__.py in <module> 53 from .configuration_xlm_roberta import XLM_ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMRobertaConfig 54 from .configuration_xlnet import XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLNetConfig ---> 55 from .data import ( 56 DataProcessor, 57 InputExample, /media/discoD/anaconda3/envs/fast-bert/lib/python3.7/site-packages/transformers/data/__init__.py in <module> 4 5 from .metrics import is_sklearn_available ----> 6 from .processors import ( 7 DataProcessor, 8 InputExample, /media/discoD/anaconda3/envs/fast-bert/lib/python3.7/site-packages/transformers/data/processors/__init__.py in <module> 3 # module, but to preserve other warnings. So, don't check this module at all. 4 ----> 5 from .glue import glue_convert_examples_to_features, glue_output_modes, glue_processors, glue_tasks_num_labels 6 from .squad import SquadExample, SquadFeatures, SquadV1Processor, SquadV2Processor, squad_convert_examples_to_features 7 from .utils import DataProcessor, InputExample, InputFeatures, SingleSentenceClassificationProcessor /media/discoD/anaconda3/envs/fast-bert/lib/python3.7/site-packages/transformers/data/processors/glue.py in <module> 21 22 from ...file_utils import is_tf_available ---> 23 from ...tokenization_utils import PreTrainedTokenizer 24 from .utils import DataProcessor, InputExample, InputFeatures 25 /media/discoD/anaconda3/envs/fast-bert/lib/python3.7/site-packages/transformers/tokenization_utils.py in <module> 27 from typing import List, Optional, Sequence, Tuple, Union 28 ---> 29 from tokenizers import AddedToken, Encoding 30 from tokenizers.decoders import Decoder 31 from tokenizers.implementations import BaseTokenizer ImportError: cannot import name 'AddedToken' from 'tokenizers' (/media/discoD/anaconda3/envs/fast-bert/lib/python3.7/site-packages/tokenizers/__init__.py) ```
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4229/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4229/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4228
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4228/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4228/comments
https://api.github.com/repos/huggingface/transformers/issues/4228/events
https://github.com/huggingface/transformers/issues/4228
614,649,997
MDU6SXNzdWU2MTQ2NDk5OTc=
4,228
Reformer tokenizer not working
{ "login": "prajjwal1", "id": 24690051, "node_id": "MDQ6VXNlcjI0NjkwMDUx", "avatar_url": "https://avatars.githubusercontent.com/u/24690051?v=4", "gravatar_id": "", "url": "https://api.github.com/users/prajjwal1", "html_url": "https://github.com/prajjwal1", "followers_url": "https://api.github.com/users/prajjwal1/followers", "following_url": "https://api.github.com/users/prajjwal1/following{/other_user}", "gists_url": "https://api.github.com/users/prajjwal1/gists{/gist_id}", "starred_url": "https://api.github.com/users/prajjwal1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/prajjwal1/subscriptions", "organizations_url": "https://api.github.com/users/prajjwal1/orgs", "repos_url": "https://api.github.com/users/prajjwal1/repos", "events_url": "https://api.github.com/users/prajjwal1/events{/privacy}", "received_events_url": "https://api.github.com/users/prajjwal1/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,588
1,588
1,588
CONTRIBUTOR
null
# 🐛 Bug `TextDataset` throws out of index error. ## Information ``` model_args = ModelArguments(model_name_or_path = 'Reformer', config_name = 'ReformerConfig', tokenizer_name = 'ReformerTokenizer') training_args = TrainingArguments(output_dir = '/tmp', do_train = True, evaluate_during_training = True, do_eval = True, do_predict = False) data_args = DataTrainingArguments(train_data_file = TRAIN_DATA_DIR, eval_data_file = EVAL_DATA_DIR, line_by_line = True) tokenizer = AutoTokenizer.from_pretrained("google/reformer-crime-and-punishment", cache_dir=model_args.cache_dir) train_dataset = ( get_dataset(data_args, tokenizer=tokenizer, local_rank=training_args.local_rank) if training_args.do_train else None ) eval_dataset = ( get_dataset(data_args, tokenizer=tokenizer, local_rank=training_args.local_rank, evaluate=True) if training_args.do_eval else None ) ``` It throws this: ``` ~/.local/lib/python3.6/site-packages/transformers/tokenization_utils.py in truncate_sequences(self, ids, pair_ids, num_tokens_to_remove, truncation_strategy, stride) 2044 for _ in range(num_tokens_to_remove): 2045 if pair_ids is None or len(ids) > len(pair_ids): -> 2046 overflowing_tokens = [ids[-1]] + overflowing_tokens 2047 ids = ids[:-1] 2048 else: IndexError: list index out of range ``` When `line_by_line` is kept False, ``` train_dataset[0] ``` returns ``` ~/.local/lib/python3.6/site-packages/transformers/data/datasets/language_modeling.py in __getitem__(self, i) 72 73 def __getitem__(self, i) -> torch.Tensor: ---> 74 return torch.tensor(self.examples[i], dtype=torch.long) 75 76 IndexError: list index out of range ``` Model I am using (Bert, XLNet ...): Reformer Language I am using the model on (English, Chinese ...): English The problem arises when using: * [x] the official example scripts: (give details below) * [ ] my own modified scripts: (give details below) The tasks I am working on is: * [ ] an official GLUE/SQUaD task: (give the name) wikitext-2 * [ ] my own task or dataset: (give details below) <!-- If you have code snippets, error messages, stack traces please provide them here as well. Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.--> ## Expected behavior `TextDataset` should work as per standard Pytorch `Dataset` class. ## Environment info <!-- You can run the command `transformers-cli env` and copy-and-paste its output below. Don't forget to fill out the missing fields in that output! --> - `transformers` version: 2.9 - Platform: Ubuntu 18.04 - Python version: 3.8 - PyTorch version (GPU?): 1.5 - Tensorflow version (GPU?): NA - Using GPU in script?: No - Using distributed or parallel set-up in script?: No
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4228/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4228/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4227
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4227/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4227/comments
https://api.github.com/repos/huggingface/transformers/issues/4227/events
https://github.com/huggingface/transformers/issues/4227
614,616,649
MDU6SXNzdWU2MTQ2MTY2NDk=
4,227
2.9.0 Padding Bug
{ "login": "pashok3d", "id": 35535358, "node_id": "MDQ6VXNlcjM1NTM1MzU4", "avatar_url": "https://avatars.githubusercontent.com/u/35535358?v=4", "gravatar_id": "", "url": "https://api.github.com/users/pashok3d", "html_url": "https://github.com/pashok3d", "followers_url": "https://api.github.com/users/pashok3d/followers", "following_url": "https://api.github.com/users/pashok3d/following{/other_user}", "gists_url": "https://api.github.com/users/pashok3d/gists{/gist_id}", "starred_url": "https://api.github.com/users/pashok3d/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pashok3d/subscriptions", "organizations_url": "https://api.github.com/users/pashok3d/orgs", "repos_url": "https://api.github.com/users/pashok3d/repos", "events_url": "https://api.github.com/users/pashok3d/events{/privacy}", "received_events_url": "https://api.github.com/users/pashok3d/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null }, { "id": 1834056635, "node_id": "MDU6TGFiZWwxODM0MDU2NjM1", "url": "https://api.github.com/repos/huggingface/transformers/labels/Core:%20Tokenization", "name": "Core: Tokenization", "color": "FF4446", "default": false, "description": "Internals of the library; Tokenization." } ]
closed
false
null
[]
[ "Can you provide a smaller reproduction case?", "```\r\n# Downloading pre-trained model\r\n!wget https://github.com/sdadas/polish-roberta/releases/download/models/roberta_base_transformers.zip\r\n!unzip roberta_base_transformers.zip -d roberta_base_transformers\r\n!pip install transformers -q\r\n\r\nfrom tokenizers import SentencePieceBPETokenizer\r\nfrom tokenizers.processors import RobertaProcessing\r\nfrom transformers import RobertaModel, AutoModel\r\n\r\n# Loading tokenizer\r\nmodel_dir = \"roberta_base_transformers\"\r\ntokenizer = SentencePieceBPETokenizer(f\"{model_dir}/vocab.json\", f\"{model_dir}/merges.txt\")\r\ngetattr(tokenizer, \"_tokenizer\").post_processor = RobertaProcessing(sep=(\"</s>\", 2), cls=(\"<s>\", 0))\r\n\r\n# Loading model\r\nmodel: RobertaModel = AutoModel.from_pretrained(model_dir)\r\n\r\ninput = tokenizer.encode(\"Ala ma kota.\")\r\noutput = model(torch.tensor([input.ids]))[0]\r\nprint(output[0][1])\r\n```\r\n", "same here!\r\ntransformers 2.8.0 works fine. but 'transformers >= 2.9.0' produce exactly same error.", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n", "trouble shooting\r\n```\r\nposition_ids = create_position_ids_from_input_ids(input_ids, self.padding_idx).to(input_ids.device)\r\nmask = input_ids.ne(padding_idx).int()\r\n...\r\nne() received an invalid combination of arguments - got (NoneType)\r\n```\r\njust modify 'pad_token_id: null' to 'pad_token_id: 1' in `config.json`" ]
1,588
1,604
1,598
CONTRIBUTOR
null
# 🐛 Bug ## Information Model I am using (Bert, XLNet ...): **Roberta with RobertaForSequenceClassification head** Language I am using the model on (English, Chinese ...): **Polish** The problem arises when using: * [ ] the official example scripts: (give details below) * [x] my own modified scripts: (give details below) **The problem arises when performing a forward pass while training. I assume something is wrong with padding, though with 2.8.0 version it works correctly.** The tasks I am working on is: * [ ] an official GLUE/SQUaD task: (give the name) * [x] my own task or dataset: (give details below) **I'm using pre-trained roBERTa model for classification task. Details can be found in the notebook below.** ## To reproduce Steps to reproduce the behavior: 1. Run https://colab.research.google.com/drive/1w54ScQ3-dh99-cO4OGG6-IdP4JRfki59?usp=sharing Error message: ``` 56 # Perform a forward pass ---> 57 loss, logits = model(b_input_ids, token_type_ids=None, attention_mask=b_input_mask, labels=b_labels) ... 2033 """ 2034 # The series of casts and type-conversions here are carefully balanced to both work with ONNX export and XLA. -> 2035 mask = input_ids.ne(padding_idx).int() 2036 incremental_indices = torch.cumsum(mask, dim=1).type_as(mask) * mask 2037 return incremental_indices.long() + padding_idx TypeError: ne() received an invalid combination of arguments - got (NoneType), but expected one of: * (Tensor other) didn't match because some of the arguments have invalid types: (!NoneType!) * (Number other) didn't match because some of the arguments have invalid types: (!NoneType!) ``` ## Expected behavior It should work without errors. The problem arises after installing 2.9.0 version. With 2.8.0 version it works correctly. ## Environment info <!-- You can run the command `transformers-cli env` and copy-and-paste its output below. Don't forget to fill out the missing fields in that output! --> - `transformers` version: **2.9.0** - Platform: Google colab - Python version: 3.6.9 - PyTorch version (GPU?): 1.5.0+cu101 - Tensorflow version (GPU?): 2.2.0rc4 - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: n/a
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4227/reactions", "total_count": 6, "+1": 5, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 1, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4227/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4226
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4226/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4226/comments
https://api.github.com/repos/huggingface/transformers/issues/4226/events
https://github.com/huggingface/transformers/pull/4226
614,585,645
MDExOlB1bGxSZXF1ZXN0NDE1MTA5Nzk0
4,226
Simplify cache vars and allow for TRANSFORMERS_CACHE env
{ "login": "BramVanroy", "id": 2779410, "node_id": "MDQ6VXNlcjI3Nzk0MTA=", "avatar_url": "https://avatars.githubusercontent.com/u/2779410?v=4", "gravatar_id": "", "url": "https://api.github.com/users/BramVanroy", "html_url": "https://github.com/BramVanroy", "followers_url": "https://api.github.com/users/BramVanroy/followers", "following_url": "https://api.github.com/users/BramVanroy/following{/other_user}", "gists_url": "https://api.github.com/users/BramVanroy/gists{/gist_id}", "starred_url": "https://api.github.com/users/BramVanroy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/BramVanroy/subscriptions", "organizations_url": "https://api.github.com/users/BramVanroy/orgs", "repos_url": "https://api.github.com/users/BramVanroy/repos", "events_url": "https://api.github.com/users/BramVanroy/events{/privacy}", "received_events_url": "https://api.github.com/users/BramVanroy/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,588
1,589
1,589
COLLABORATOR
null
As it currently stands, "TRANSFORMERS_CACHE" is not an accepted environment variable. It seems that the these variables were not updated when moving from version pytorch_transformers to transformers. In addition, the fallback procedure could be improved. and simplified. Pathlib seems redundant here. This PR: - adds the TRANSFORMERS_CACHE environment variable - change the fall-back order of the cache env variables File_utils (and perhaps the rest of the library) might benefit from using pathlib more widely. In a future endeavour I might take this on.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4226/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4226/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4226", "html_url": "https://github.com/huggingface/transformers/pull/4226", "diff_url": "https://github.com/huggingface/transformers/pull/4226.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4226.patch", "merged_at": 1589225043000 }
https://api.github.com/repos/huggingface/transformers/issues/4225
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4225/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4225/comments
https://api.github.com/repos/huggingface/transformers/issues/4225/events
https://github.com/huggingface/transformers/issues/4225
614,514,275
MDU6SXNzdWU2MTQ1MTQyNzU=
4,225
[Reformer/Longformer] Add cross-attention layers for Encoder-Decoder setting
{ "login": "patil-suraj", "id": 27137566, "node_id": "MDQ6VXNlcjI3MTM3NTY2", "avatar_url": "https://avatars.githubusercontent.com/u/27137566?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patil-suraj", "html_url": "https://github.com/patil-suraj", "followers_url": "https://api.github.com/users/patil-suraj/followers", "following_url": "https://api.github.com/users/patil-suraj/following{/other_user}", "gists_url": "https://api.github.com/users/patil-suraj/gists{/gist_id}", "starred_url": "https://api.github.com/users/patil-suraj/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patil-suraj/subscriptions", "organizations_url": "https://api.github.com/users/patil-suraj/orgs", "repos_url": "https://api.github.com/users/patil-suraj/repos", "events_url": "https://api.github.com/users/patil-suraj/events{/privacy}", "received_events_url": "https://api.github.com/users/patil-suraj/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
{ "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false }
[ { "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false } ]
[ "It's a good question. I originally thought it will be quite easy to add - but it's not going to be that trivial.\r\n\r\nFor the encoder-decoder setting, we need a lsh cross attention layer that receives different embeddings for query and keys so that the usual LSH hashing method does not work. \r\n\r\nIt will probably take a while until this is implemented since as far as I know the authors of Reformer themselves are still working on it.\r\n", "This question could also be a good opportunity to brainstorm a bit on how a LSH Cross Attention layer could look like :-) ", "Are you referring to https://github.com/google/trax/blob/25479c577ef28780118a4f0169e1c7f5a028a7a3/trax/models/reformer/reformer.py#L846-L847 ?\r\n\r\nI assume the approach taken for the encoder-decoder in the [machine translation notebook](https://github.com/google/trax/blob/25479c577ef28780118a4f0169e1c7f5a028a7a3/trax/models/reformer/machine_translation.ipynb) wouldn't work here?", "Yeah, for now, we could do the same as is done there and simply add normal \"non-chunked\" attention for encoder-decoder settings. I'll think about it.", "> Yeah, for now, we could do the same as is done there and simply add normal \"non-chunked\" attention for encoder-decoder settings. I'll think about it.\r\n\r\nHi Patrick, any update on this?\r\n\r\nThanks :)", "I will take a while until this is implemented. Not sure if @patil-suraj already has an idea of how he would implement it :-) ", "@patrickvonplaten there's been an update on https://github.com/google/trax/issues/539#issuecomment-647980326", "Awesome thanks for noting that! \r\nI try to take a look at this as soon as possible. \r\nLongformer and Reformer Encoder-Decoder models definitely are of high priority :-) ", "@patrickvonplaten how is the Reformer Encoder Decoder coming along? I would like to compare this model to Longformer Encoder Decoder for long document summarisation so I will probably begin working on this soon if it still looks to be a while away.", "@alexgaskell10, if you want to implement it yourself, you can use a regular encoder-decoder model with the LSH selfattention in the encoder only. The other two attention blocks in the decoder (crossattention and final selfattention) can still use the regular full attention. This works when the output length is not very long, which is typically the case. You won't get the memory savings of the reversible transformer, but maybe you don't need it and gradient checkpointing is enough. \r\n\r\nI am curious if you already have numbers for LongformerEncoderDecoder that you can share?\r\n\r\n", "@ibeltagy thanks for this. Yes, that is my plan- begin with implementing the self-attention in the encoder and then add the other memory-saving features if necessary. This will probably be fine for my use-case as the encoder is the main memory bottleneck.\r\n\r\nI have run lots of experiments for input lengths < 1024 tokens. I am in the process of running more with input len > 1024 but the early results have been strange so I need to do some digging and these aren't ready to share. I'll post them here when they are ready. In the meantime, are you interested in experiments with < 1024 tokens?", "I want to give a short update on EncoderDecoder models for Longformer / Reformer from my side.\r\n\r\nGiven that the Reformer Encoder / Decoder code is still very researchy in teh original `trax` code-base and thus prone to still change, we will probably wait a bit until we implement Reformer Encoder/Decoder logic for `transformers`. \r\n\r\nFrom my experience, few people would take the Reformer Encoder/Decoder framework to do massive pre-training from scratch. Most likely, we will wait until the Reformer authors publish weights or it least a paper. \r\n\r\nAt the moment, I work on fine-tuning a Bert2Bert model via the Encoder/Decoder framework (use two pretrained `bert-base-uncased` models => `EncoderDecoder.from_pretrained(\"bert-base-cased\", \"bert-base-cased\")` and fine-tune the model. This means especially the decoder weights have to be adapted a lot, since in the EncoderDecoder framework the model has a causal mask and the cross attention layers are to be trained from scratch. The results so far are quite promising in that it might not be too difficult to fine-tune two pretrained \"encoder-only\" models into an encoder-decoder model. \r\n\r\nSince Reformer also does not yet have a massively pretrained bi-directional encoder-only model, the focus will most likely shift to the Longformer encoder-decoder framework afterwards. Longformer has more traction, more pre-trained models and is more similar to Bert2Bert fine-tuning.\r\n\r\n\r\nThat's mostly my personal opinion - I would be very interested in your opinions about it!", "hi @patrickvonplaten , I agree with you here. I also wanted to implement Reformer Encoder/Decoder but as no previous experiment are available from original authors and no pre-trained weight are provided I decided to go with `LongBart ` i.e replacing BART's attention with `Longformars` sliding window attention. @alexgaskell10 has already experimented with it and it seems to be doing good enough. @ibeltagy has also added `LongformerEncoderDeocder` using BART weights.\r\n\r\nAs pre-trained weights are already available for `Longformer` and as the sliding window attention can be used as drop-in replacement for self attention prioritizing Longformer encoder-decoder it makes more sense to me than Reformer ", "Thanks for the update @patrickvonplaten and I think that sounds sensible. Having looked into them both Longformer ED is definitely more straightforward to implement than Reformer ED and in my experiments so far it has performed pretty well so makes sense to focus efforts here. \r\n\r\nI had started working on the Reformer ED before your update and I have a working implementation (just the bare bones- replacing Bart's Encoder's self attention layers with the local/lsh layers from Reformer). I am running some early experiments on it at the moment but I don't expect it to perform well as the self-attention layers are trained from scratch. I'll share an update if anything interesting arises.\r\n\r\n> I work on fine-tuning a Bert2Bert model via the Encoder/Decoder framework\r\n\r\nSounds cool, look forward to trying it out!", "Oh I cannit wait for this to be ready. 😍\r\n\r\nI have a seq2seq problem with documents which are good enough that I need this to be ready before I can hope to solve my task. ", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,588
1,602
1,602
MEMBER
null
# ❓ Questions & Help ## Details It seems that Reformer model has been added in Transformers. But it's a standard auto-regressive language model. How can we use Reformer in Encoder-Decoder settings ?
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4225/reactions", "total_count": 6, "+1": 6, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4225/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4224
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4224/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4224/comments
https://api.github.com/repos/huggingface/transformers/issues/4224/events
https://github.com/huggingface/transformers/issues/4224
614,493,428
MDU6SXNzdWU2MTQ0OTM0Mjg=
4,224
Bart now enforces maximum sequence length in Summarization Pipeline
{ "login": "pwschaedler", "id": 8781353, "node_id": "MDQ6VXNlcjg3ODEzNTM=", "avatar_url": "https://avatars.githubusercontent.com/u/8781353?v=4", "gravatar_id": "", "url": "https://api.github.com/users/pwschaedler", "html_url": "https://github.com/pwschaedler", "followers_url": "https://api.github.com/users/pwschaedler/followers", "following_url": "https://api.github.com/users/pwschaedler/following{/other_user}", "gists_url": "https://api.github.com/users/pwschaedler/gists{/gist_id}", "starred_url": "https://api.github.com/users/pwschaedler/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/pwschaedler/subscriptions", "organizations_url": "https://api.github.com/users/pwschaedler/orgs", "repos_url": "https://api.github.com/users/pwschaedler/repos", "events_url": "https://api.github.com/users/pwschaedler/events{/privacy}", "received_events_url": "https://api.github.com/users/pwschaedler/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
{ "login": "mfuntowicz", "id": 2241520, "node_id": "MDQ6VXNlcjIyNDE1MjA=", "avatar_url": "https://avatars.githubusercontent.com/u/2241520?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mfuntowicz", "html_url": "https://github.com/mfuntowicz", "followers_url": "https://api.github.com/users/mfuntowicz/followers", "following_url": "https://api.github.com/users/mfuntowicz/following{/other_user}", "gists_url": "https://api.github.com/users/mfuntowicz/gists{/gist_id}", "starred_url": "https://api.github.com/users/mfuntowicz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mfuntowicz/subscriptions", "organizations_url": "https://api.github.com/users/mfuntowicz/orgs", "repos_url": "https://api.github.com/users/mfuntowicz/repos", "events_url": "https://api.github.com/users/mfuntowicz/events{/privacy}", "received_events_url": "https://api.github.com/users/mfuntowicz/received_events", "type": "User", "site_admin": false }
[ { "login": "mfuntowicz", "id": 2241520, "node_id": "MDQ6VXNlcjIyNDE1MjA=", "avatar_url": "https://avatars.githubusercontent.com/u/2241520?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mfuntowicz", "html_url": "https://github.com/mfuntowicz", "followers_url": "https://api.github.com/users/mfuntowicz/followers", "following_url": "https://api.github.com/users/mfuntowicz/following{/other_user}", "gists_url": "https://api.github.com/users/mfuntowicz/gists{/gist_id}", "starred_url": "https://api.github.com/users/mfuntowicz/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mfuntowicz/subscriptions", "organizations_url": "https://api.github.com/users/mfuntowicz/orgs", "repos_url": "https://api.github.com/users/mfuntowicz/repos", "events_url": "https://api.github.com/users/mfuntowicz/events{/privacy}", "received_events_url": "https://api.github.com/users/mfuntowicz/received_events", "type": "User", "site_admin": false } ]
[ "#3857 might also be a culprit", "@pwschaedler This is a change in pipelines that we may or may not undo. Previously, the tokenizer truncated your long documents to their beginnings\r\nIn the meantime, you can use this code on the latest transformers:\r\n\r\n```python\r\nfrom transformers import BartForConditionalGeneration, BartTokenizer\r\nfrom typing import List\r\n\r\ndef old_summarization_pipeline(text: List[str]) -> List[str]:\r\n tokenizer = BartTokenizer.from_pretrained('bart-large-cnn')\r\n model = BartForConditionalGeneration.from_pretrained('bart-large-cnn')\r\n input_ids = tokenizer.batch_encode_plus(text, return_tensors='pt', max_length=1024)['input_ids']\r\n summary_ids = model.generate(input_ids)\r\n summaries = [tokenizer.decode(s) for s in summary_ids]\r\n return summaries\r\n\r\n```\r\n\r\n```python\r\ntext = '=' * 10257 \r\nold_summarization_pipeline(text)\r\n```", "Great, thanks for the replacement code. The token limit (whether it's enforced or implied) might be worth mentioning on the pipeline docs.", "Agreed! Would you be interested in sending a PR? The SummarizationPipeline docs live in `docs/source/main_classes/pipelines.rst` I believe.", "Issue still exists when using summarisation pipeline. `WARNING:transformers.tokenization_utils:Token indices sequence length is longer than the specified maximum sequence length for this model (2817 > 1024). Running this sequence through the model will result in indexing errors\r\nIndexError: index out of range in self\r\n`\r\nI saw the above work-around but when can we expect this to be fixed in summarization pipeline as well?", "I am curious why the token limit in the summarization pipeline stops the process for the default model and for BART but not for the T-5 model? When running \"t5-large\" in the pipeline it will say \"Token indices sequence length is longer than the specified maximum sequence length for this model (1069 > 512)\" but it will still produce a summary. With the default model or \"facebook/bart-large-cnn\" models it will give a similar message \"Token indices sequence length is longer than the specified maximum sequence length for this model (1034 > 1024).\" but then fail to produce a summary (and give the following \"index out of range in self\"). Thanks!", "Great Q, (prolly belongs on [discuss.huggingface.co](https://discuss.huggingface.co/) in the future :)) \r\n\r\nT5 uses a technique called relative position bucketing, whereas bart stores 1024 positional embeddings and then looks up each position in them. \r\nNote that T5 will likely perform best with sequences <= 512 tokens, but you are correct that it won't error until OOM.\r\n\r\n[relevant t5 code] (https://github.com/huggingface/transformers/blob/c67d1a0259cbb3aef31952b4f37d4fee0e36f134/src/transformers/modeling_t5.py#L242)", "@sshleifer what's the typical recommendation for summarization on larger documents? Chunk them and generate summaries or any other tips?\r\n\r\nEDIT: Cross-posted __[here](https://discuss.huggingface.co/t/summarization-on-long-documents/920/5)__, I think this is a much better place for this.\r\n\r\nThis is what I use currently but open to better recommendations.\r\n\r\n```python\r\n# generate chunks of text \\ sentences <= 1024 tokens\r\ndef nest_sentences(document):\r\n nested = []\r\n sent = []\r\n length = 0\r\n for sentence in nltk.sent_tokenize(document):\r\n length += len(sentence)\r\n if length < 1024:\r\n sent.append(sentence)\r\n else:\r\n nested.append(sent)\r\n sent = []\r\n length = 0\r\n\r\n if sent:\r\n nested.append(sent)\r\n return nested\r\n\r\n# generate summary on text with <= 1024 tokens\r\ndef generate_summary(nested_sentences):\r\n device = 'cuda'\r\n summaries = []\r\n for nested in nested_sentences:\r\n input_tokenized = bart_tokenizer.encode(' '.join(nested), truncation=True, return_tensors='pt')\r\n input_tokenized = input_tokenized.to(device)\r\n summary_ids = bart_model.to(device).generate(input_tokenized,\r\n length_penalty=3.0,\r\n min_length=30,\r\n max_length=100)\r\n output = [bart_tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=False) for g in summary_ids]\r\n summaries.append(output)\r\n summaries = [sentence for sublist in summaries for sentence in sublist]\r\n return summaries\r\n```", "Hi!\r\n\r\nnest_sentences() has a bug. Whenever a chunk is ready to be saved in 'nested' the current sentence is ignored.", "Yes my bad one sentence is skipped, can be fixed as follows. Effects of implementing it in late hours ;)\r\n\r\nGood catch @echatzikyriakidis thanks!\r\n\r\n```python\r\n# generate chunks of text \\ sentences <= 1024 tokens\r\ndef nest_sentences(document):\r\n nested = []\r\n sent = []\r\n length = 0\r\n for sentence in nltk.sent_tokenize(document):\r\n length += len(sentence)\r\n if length < 1024:\r\n sent.append(sentence)\r\n else:\r\n nested.append(sent)\r\n sent = [sentence]\r\n length = len(sentence)\r\n\r\n if sent:\r\n nested.append(sent)\r\n return nested\r\n```", "Hi @dipanjanS !\r\n\r\nThank you! This is exactly the way I did it also.\r\n\r\nI think there is another catch.\r\n\r\nWhat if a sentence is > 512 in case of T5 models or > 1024 in case of BART (rare scenario).\r\n\r\nI think there will be no problem because of truncation=True, right? Or is going to fail? Maybe we need to skip it or split it in half.", "Great. I think in those cases 1024 is a hard coded magic number which can be configurable and replaced with the max length allowed by that specific model maybe as a function parameter", "Hi @dipanjanS,\r\n\r\nThis is the way I have done it.\r\n\r\nBut again, what if a sentence is greater than the model's l max input length?\r\n\r\nWhat will happen then?", "I think if we enforce the truncation parameter it should take care of it.\nBy default it was being done in previous releases of transformers I think\nbut now we might have to set it ourselves. But do check it out once.\n\nOn Mon, Sep 21, 2020, 00:30 Efstathios Chatzikyriakidis <\[email protected]> wrote:\n\n> Hi @dipanjanS <https://github.com/dipanjanS>,\n>\n> This is the way I have done it.\n>\n> But again, what if a sentence is greater than the model's l max input\n> length?\n>\n> What will happen then?\n>\n> —\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/huggingface/transformers/issues/4224#issuecomment-695822993>,\n> or unsubscribe\n> <https://github.com/notifications/unsubscribe-auth/AA2J3R6Y2O3VR5KBUXYDUBTSGZGN3ANCNFSM4M3342EA>\n> .\n>\n", "Hi @dipanjanS,\r\n\r\nExactly, I have tested it.", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n", "Hi @sshleifer first of all thanks for creating and maintaining this repo!\r\n\r\nI'm exploring the pipelines and sadly the [replacement code](https://github.com/huggingface/transformers/issues/4224#issuecomment-626401256) you shared no longer works. \r\n\r\nI added `truncation=True` to the `tokenizer.batch_encode_plus` method but another error happened: `ValueError: expected sequence of length 2 at dim 1 (got 3)` in `tokenization_utils_base.py`\r\n\r\nI saw in above discussion you were considering undoing this hard limit on the pipelines, perhaps the limit can be exposed in a configuration file or as a parameter?\r\n\r\nCould you please suggest how to overcome the hard limit? \r\n\r\nThis is my current config:\r\n```\r\n[tool.poetry.dependencies]\r\npython = \"^3.8\"\r\ntransformers = \"^4.2.2\"\r\ntorch = \"^1.7.1\"\r\n```\r\n- No GPU\r\n- OS is Linux\r\n- Model: \"sshleifer/distilbart-cnn-12-6\"\r\n\r\nThanks!", "Hi @ig-perez ,\r\nI realize this reply comes a little late to your question, but maybe it can still help you or someone else out. Here is the code from @sshleifer with some modifications to make it work for the current version.\r\n```py\r\ndef old_summarization_pipeline(text: List[str]) -> List[str]:\r\n tokenizer = BartTokenizer.from_pretrained('facebook/bart-large-cnn')\r\n model = BartForConditionalGeneration.from_pretrained('facebook/bart-large-cnn')\r\n input_ids = tokenizer.batch_encode_plus(text, truncation=True, padding=True, return_tensors='pt', max_length=1024)['input_ids']\r\n summary_ids = model.generate(input_ids)\r\n summaries = [tokenizer.decode(s, skip_special_tokens=True, clean_up_tokenization_spaces=False) for s in summary_ids]\r\n return summaries\r\n\r\nprint(old_summarization_pipeline([ARTICLE_TO_SUMMARIZE, ARTICLE_TO_SUMMARIZE_2, ARTICLE_TO_SUMMARIZE2*400]))\r\n```\r\n\r\nI tried it with:\r\n- transformers=4.4.2\r\n- pytorch=1.8.0=py3.8_cuda10.2_cudnn7.6.5_0", "Unfortunately, this problem also manifests when deploying BART on SageMaker via `sagemaker.huggingface.HuggingFaceModel`. When a request with > 1024 tokens is sent, the SageMaker endpoint crashes with an out-of-range CUDA error (we're using GPU instances). What's worse, subsequent requests with smaller inputs fail with the same CUDA error. The only fix is to redeploy the endpoint.\r\n\r\nFor now, we're using an encode-truncate-decode workaround like below, but there clearly has to be a better way:\r\n\r\n```\r\n# Inputs longer than 1024 tokens cause irrecoverable CUDA errors on\r\n# SageMaker. Make sure that each text is at most 1024 tokens.\r\ninputs = self.tokenizer(texts, max_length=1024, padding=\"longest\",\r\n truncation=True)\r\ntruncated_texts = [self.tokenizer.decode(i, skip_special_tokens=True, clean_up_tokenization_spaces=False)\r\n for i in inputs[\"input_ids\"]]\r\noutput = predictor.predict({\"inputs\": truncated_texts, \"parameters\": parameters})\r\nsummaries = [summary[\"summary_text\"] for summary in output]\r\n```", "@dipanjanS can you write a full code because it is missing a lot of parts\r\n\r\nnltk missing\r\nbart_tokenizer missing\r\nbart_model missing\r\n\r\n", "@dipanjanS Thanks for sharing your take on how to chunk large texts for summarization. I follow up on @FurkanGozukara's request: could you possibly provide the parts that are missing? \r\nThanks in advance for your help." ]
1,588
1,673
1,607
NONE
null
# 🐛 Bug ## Information Model I am using (Bert, XLNet ...): Bart (bart-large-cnn) Language I am using the model on (English, Chinese ...): English The problem arises when using: * [ ] the official example scripts: (give details below) * [x] my own modified scripts: (give details below) Based on example code in docs, though. The tasks I am working on is: * [ ] an official GLUE/SQUaD task: (give the name) * [X] my own task or dataset: (give details below) ## To reproduce Steps to reproduce the behavior: 1. Load default summarization pipeline 2. Try to use model to summarize text that has > 1024 tokens <!-- If you have code snippets, error messages, stack traces please provide them here as well. Important! Use code tags to correctly format your code. See https://help.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks#syntax-highlighting Do not use screenshots, as they are hard to read and (more importantly) don't allow others to copy-and-paste your code.--> Example code: ``` from transformers import pipeline summarizer = pipeline('summarization') text = '=' * 102570 # Happened to be the length of the file I was testing, my actual file produced 25,257 tokens print(summarizer(text)) ``` Output: ``` Token indices sequence length is longer than the specified maximum sequence length for this model (1605 > 1024). Running this sequence through the model will result in indexing errors Traceback (most recent call last): File "ex.py", line 4, in <module> print(summarizer(text, max_length=250)) File ".../lib/python3.7/site-packages/transformers/pipelines.py", line 1330, in __call__ inputs["input_ids"], attention_mask=inputs["attention_mask"], **generate_kwargs, File ".../lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 15, in decorate_context return func(*args, **kwargs) File ".../lib/python3.7/site-packages/transformers/modeling_utils.py", line 1047, in generate encoder_outputs: tuple = encoder(input_ids, attention_mask=attention_mask) File ".../lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in __call__ result = self.forward(*input, **kwargs) File ".../lib/python3.7/site-packages/transformers/modeling_bart.py", line 292, in forward embed_pos = self.embed_positions(input_ids) File ".../lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in __call__ result = self.forward(*input, **kwargs) File ".../lib/python3.7/site-packages/transformers/modeling_bart.py", line 763, in forward return super().forward(positions) File ".../lib/python3.7/site-packages/torch/nn/modules/sparse.py", line 114, in forward self.norm_type, self.scale_grad_by_freq, self.sparse) File ".../lib/python3.7/site-packages/torch/nn/functional.py", line 1724, in embedding return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse) IndexError: index out of range in self ``` ## Expected behavior As of last week (week of 4/26/2020) this caused no issue. Today (5/7/2020) I tried to run the exact same code, a new model was downloaded (no change in transformers module, just the model itself), and now it enforces a token limit. Expected behavior is to summarize document regardless of size. ## Environment info <!-- You can run the command `transformers-cli env` and copy-and-paste its output below. Don't forget to fill out the missing fields in that output! --> - `transformers` version: 2.8.0 (also occurs in 2.9.0) - Platform: Both macOS 10.15.4 and Windows 10 - Python version: 3.7.5 (Mac) and 3.6.3/Anaconda (Windows) - PyTorch version (GPU?): 1.5.0, no GPU - Tensorflow version (GPU?): n/a - Using GPU in script?: no - Using distributed or parallel set-up in script?: no - Model (from associated JSON file downloaded): `{"url": "https://s3.amazonaws.com/models.huggingface.co/bert/facebook/bart-large-cnn/pytorch_model.bin", "etag": "\"6eeacfe81d9304a6c5015424912f8df8\""}` - Model config: ``` { "_num_labels": 3, "activation_dropout": 0.0, "activation_function": "gelu", "add_final_layer_norm": false, "attention_dropout": 0.0, "bos_token_id": 0, "classif_dropout": 0.0, "d_model": 1024, "decoder_attention_heads": 16, "decoder_ffn_dim": 4096, "decoder_layerdrop": 0.0, "decoder_layers": 12, "decoder_start_token_id": 2, "dropout": 0.1, "early_stopping": true, "encoder_attention_heads": 16, "encoder_ffn_dim": 4096, "encoder_layerdrop": 0.0, "encoder_layers": 12, "eos_token_id": 2, "id2label": { "0": "LABEL_0", "1": "LABEL_1", "2": "LABEL_2" }, "init_std": 0.02, "is_encoder_decoder": true, "label2id": { "LABEL_0": 0, "LABEL_1": 1, "LABEL_2": 2 }, "length_penalty": 2.0, "max_length": 142, "max_position_embeddings": 1024, "min_length": 56, "model_type": "bart", "no_repeat_ngram_size": 3, "normalize_before": false, "num_beams": 4, "num_hidden_layers": 12, "output_past": true, "pad_token_id": 1, "prefix": " ", "scale_embedding": false, "task_specific_params": { "summarization": { "early_stopping": true, "length_penalty": 2.0, "max_length": 142, "min_length": 56, "no_repeat_ngram_size": 3, "num_beams": 4 } }, "vocab_size": 50264 } ``` EDIT: Tagging @sshleifer as recommended by docs
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4224/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4224/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4223
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4223/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4223/comments
https://api.github.com/repos/huggingface/transformers/issues/4223/events
https://github.com/huggingface/transformers/pull/4223
614,433,866
MDExOlB1bGxSZXF1ZXN0NDE0OTkyMTA3
4,223
[TPU] Doc, fix xla_spawn.py, only preprocess dataset once
{ "login": "julien-c", "id": 326577, "node_id": "MDQ6VXNlcjMyNjU3Nw==", "avatar_url": "https://avatars.githubusercontent.com/u/326577?v=4", "gravatar_id": "", "url": "https://api.github.com/users/julien-c", "html_url": "https://github.com/julien-c", "followers_url": "https://api.github.com/users/julien-c/followers", "following_url": "https://api.github.com/users/julien-c/following{/other_user}", "gists_url": "https://api.github.com/users/julien-c/gists{/gist_id}", "starred_url": "https://api.github.com/users/julien-c/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/julien-c/subscriptions", "organizations_url": "https://api.github.com/users/julien-c/orgs", "repos_url": "https://api.github.com/users/julien-c/repos", "events_url": "https://api.github.com/users/julien-c/events{/privacy}", "received_events_url": "https://api.github.com/users/julien-c/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "Ok, merging this!" ]
1,588
1,588
1,588
MEMBER
null
- Fixed the `xla_spawn.py` launcher script which I broke earlier today when moving files around. It should be reasonably more robust now. - Started to add a little documentation - Changed the dataset logic so that multiple workers don't concurrently preprocess the dataset.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4223/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4223/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4223", "html_url": "https://github.com/huggingface/transformers/pull/4223", "diff_url": "https://github.com/huggingface/transformers/pull/4223.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4223.patch", "merged_at": 1588961406000 }
https://api.github.com/repos/huggingface/transformers/issues/4222
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4222/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4222/comments
https://api.github.com/repos/huggingface/transformers/issues/4222/events
https://github.com/huggingface/transformers/issues/4222
614,417,240
MDU6SXNzdWU2MTQ0MTcyNDA=
4,222
TPU Trainer's PerDeviceLoader has no len()
{ "login": "caseysackett", "id": 8107, "node_id": "MDQ6VXNlcjgxMDc=", "avatar_url": "https://avatars.githubusercontent.com/u/8107?v=4", "gravatar_id": "", "url": "https://api.github.com/users/caseysackett", "html_url": "https://github.com/caseysackett", "followers_url": "https://api.github.com/users/caseysackett/followers", "following_url": "https://api.github.com/users/caseysackett/following{/other_user}", "gists_url": "https://api.github.com/users/caseysackett/gists{/gist_id}", "starred_url": "https://api.github.com/users/caseysackett/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/caseysackett/subscriptions", "organizations_url": "https://api.github.com/users/caseysackett/orgs", "repos_url": "https://api.github.com/users/caseysackett/repos", "events_url": "https://api.github.com/users/caseysackett/events{/privacy}", "received_events_url": "https://api.github.com/users/caseysackett/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "@jysohn23 (and @dlibenzi) might want to chime in on this but I think this works in xla's nightly from https://github.com/pytorch/xla/pull/1991\r\n\r\n(We might still want to improve things but if this is blocking you, please try using the nightly build of xla)", "Yeah it's recently been added, so if you could select a newer version in the first cell of your colab notebook (`env-setup.py` script), it should do.", "Thanks for the quick response. Confirmed that using the \"nightly\" build of XLA works, so closing this issue." ]
1,588
1,589
1,589
NONE
null
# 🐛 Bug The new TPU Trainer fails when running on a single TPU core in a colab notebook since the XLA ParallelLoader's PerDeviceLoader does not implement a length method. ## Information Model I am using (Bert, XLNet ...): Bert Language I am using the model on (English, Chinese ...): English The problem arises when using: * [ ] the official example scripts: (give details below) * [x] my own modified scripts: (give details below) The tasks I am working on is: * [ ] an official GLUE/SQUaD task: (give the name) * [x] my own task or dataset: (give details below) ## To reproduce I used a custom script, but I would imagine it's not hard to reproduce using one of the example scripts. The error trace is below, with the relevant line in bold: `Exception in device=TPU:0: object of type 'PerDeviceLoader' has no len() Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/torch_xla/distributed/xla_multiprocessing.py", line 119, in _start_fn fn(gindex, *args) File "<ipython-input-6-3aa4c6105066>", line 264, in main trainer.train() File "/usr/local/lib/python3.6/dist-packages/transformers/trainer.py", line 286, in train **t_total = int(len(train_dataloader) // self.args.gradient_accumulation_steps *** self.args.num_train_epochs) TypeError: object of type 'PerDeviceLoader' has no len() An exception has occurred, use %tb to see the full traceback.` ## Expected behavior Based on the conversation in the issue linked below, the PerDeviceLoader does not implement length, so the Trainer would need to be aware of that and get the length another way. https://github.com/pytorch/xla/issues/1191 ## Environment info - `transformers` version: 2.9.0 - Platform: Linux-4.19.104+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.6.9 - PyTorch version (GPU?): 1.5.0a0+ab660ae (False) - Tensorflow version (GPU?): 2.2.0-rc4 (False) - Using GPU in script?: Using TPU - Using distributed or parallel set-up in script?: XLA is used by the Trainer, but it's a single core TPU in a colab notebook
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4222/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4222/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4221
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4221/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4221/comments
https://api.github.com/repos/huggingface/transformers/issues/4221/events
https://github.com/huggingface/transformers/pull/4221
614,408,495
MDExOlB1bGxSZXF1ZXN0NDE0OTcxNzg3
4,221
feat(trainer): log epoch and final metrics
{ "login": "borisdayma", "id": 715491, "node_id": "MDQ6VXNlcjcxNTQ5MQ==", "avatar_url": "https://avatars.githubusercontent.com/u/715491?v=4", "gravatar_id": "", "url": "https://api.github.com/users/borisdayma", "html_url": "https://github.com/borisdayma", "followers_url": "https://api.github.com/users/borisdayma/followers", "following_url": "https://api.github.com/users/borisdayma/following{/other_user}", "gists_url": "https://api.github.com/users/borisdayma/gists{/gist_id}", "starred_url": "https://api.github.com/users/borisdayma/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/borisdayma/subscriptions", "organizations_url": "https://api.github.com/users/borisdayma/orgs", "repos_url": "https://api.github.com/users/borisdayma/repos", "events_url": "https://api.github.com/users/borisdayma/events{/privacy}", "received_events_url": "https://api.github.com/users/borisdayma/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4221?src=pr&el=h1) Report\n> Merging [#4221](https://codecov.io/gh/huggingface/transformers/pull/4221?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/c99fe0386be118bceaab1c85cdb8309eb8cb8208&el=desc) will **increase** coverage by `0.02%`.\n> The diff coverage is `39.39%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4221/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4221?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4221 +/- ##\n==========================================\n+ Coverage 78.31% 78.34% +0.02% \n==========================================\n Files 120 120 \n Lines 19854 19864 +10 \n==========================================\n+ Hits 15549 15562 +13 \n+ Misses 4305 4302 -3 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4221?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [src/transformers/trainer.py](https://codecov.io/gh/huggingface/transformers/pull/4221/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy90cmFpbmVyLnB5) | `42.73% <39.39%> (+2.55%)` | :arrow_up: |\n| [src/transformers/modeling\\_tf\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4221/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `92.77% <0.00%> (ø)` | |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4221?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4221?src=pr&el=footer). Last update [c99fe03...f220d8f](https://codecov.io/gh/huggingface/transformers/pull/4221?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "Already merged through PR #4324" ]
1,588
1,591
1,591
CONTRIBUTOR
null
This PR adds new logging capabilities to `Trainer`: * logs epoch -> this let us compare runs with different batch sizes, using "epoch" as the x-axis instead of "global_step" * logs final metrics -> metrics are also logged by `Trainer.evaluate` at the end of the script (or at the start if we just use `--do_eval` and not train). In below example, we see `epoch` has been used for x-axis and `eval_loss` has one extra point corresponding to the end of the script. ![image](https://user-images.githubusercontent.com/715491/81350982-d57e5600-9088-11ea-8ce6-400bda09bea7.png)
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4221/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4221/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4221", "html_url": "https://github.com/huggingface/transformers/pull/4221", "diff_url": "https://github.com/huggingface/transformers/pull/4221.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4221.patch", "merged_at": null }
https://api.github.com/repos/huggingface/transformers/issues/4220
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4220/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4220/comments
https://api.github.com/repos/huggingface/transformers/issues/4220/events
https://github.com/huggingface/transformers/pull/4220
614,404,557
MDExOlB1bGxSZXF1ZXN0NDE0OTY4NTY3
4,220
Improvements to the wandb integration
{ "login": "vanpelt", "id": 17, "node_id": "MDQ6VXNlcjE3", "avatar_url": "https://avatars.githubusercontent.com/u/17?v=4", "gravatar_id": "", "url": "https://api.github.com/users/vanpelt", "html_url": "https://github.com/vanpelt", "followers_url": "https://api.github.com/users/vanpelt/followers", "following_url": "https://api.github.com/users/vanpelt/following{/other_user}", "gists_url": "https://api.github.com/users/vanpelt/gists{/gist_id}", "starred_url": "https://api.github.com/users/vanpelt/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vanpelt/subscriptions", "organizations_url": "https://api.github.com/users/vanpelt/orgs", "repos_url": "https://api.github.com/users/vanpelt/repos", "events_url": "https://api.github.com/users/vanpelt/events{/privacy}", "received_events_url": "https://api.github.com/users/vanpelt/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "Hey guys, any updates on this?", "@vanpelt Can't push to your fork so will tweak things in #4324 and combine with @borisdayma's #4221 " ]
1,588
1,589
1,589
CONTRIBUTOR
null
Hey guys, I'm one of the founders of W&B and have been working with @borisdayma on the wandb integration. I made a few changes to address a few cases we thought through: 1. If wandb is installed but the user hasn't logged in we now print a warning instead of prompting for an api_key 2. Made messaging more clear on how to install wandb and linked to more documentation 3. Added an environment variable for disabling wandb. This is important for users using fastai or lightning with their own wandb callback. 4. Added an environment variable for disabling wandb.watch. Because we're pulling gradients and parameters during training there is a small performance impact on training. We wanted to make it easy for users to disable this feature. Happy to iterate on any feedback you guys have. Really excited about this integration!
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4220/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4220/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4220", "html_url": "https://github.com/huggingface/transformers/pull/4220", "diff_url": "https://github.com/huggingface/transformers/pull/4220.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4220.patch", "merged_at": 1589322105000 }
https://api.github.com/repos/huggingface/transformers/issues/4219
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4219/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4219/comments
https://api.github.com/repos/huggingface/transformers/issues/4219/events
https://github.com/huggingface/transformers/issues/4219
614,402,367
MDU6SXNzdWU2MTQ0MDIzNjc=
4,219
Need correction in GPT-2 perplexity equation based on computation
{ "login": "states786", "id": 64096105, "node_id": "MDQ6VXNlcjY0MDk2MTA1", "avatar_url": "https://avatars.githubusercontent.com/u/64096105?v=4", "gravatar_id": "", "url": "https://api.github.com/users/states786", "html_url": "https://github.com/states786", "followers_url": "https://api.github.com/users/states786/followers", "following_url": "https://api.github.com/users/states786/following{/other_user}", "gists_url": "https://api.github.com/users/states786/gists{/gist_id}", "starred_url": "https://api.github.com/users/states786/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/states786/subscriptions", "organizations_url": "https://api.github.com/users/states786/orgs", "repos_url": "https://api.github.com/users/states786/repos", "events_url": "https://api.github.com/users/states786/events{/privacy}", "received_events_url": "https://api.github.com/users/states786/received_events", "type": "User", "site_admin": false }
[ { "id": 1314768611, "node_id": "MDU6TGFiZWwxMzE0NzY4NjEx", "url": "https://api.github.com/repos/huggingface/transformers/labels/wontfix", "name": "wontfix", "color": "ffffff", "default": true, "description": null } ]
closed
false
null
[]
[ "Off-topic, but it's high time that Github supports KaTeX =)", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n" ]
1,588
1,594
1,594
NONE
null
# ❓ Questions & Help I would like to formulate GPT-2 perplexity [calculation ](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py#L266)in terms of equation as under: ![image](https://user-images.githubusercontent.com/64096105/81352017-2d8b7b80-90ce-11ea-8cdd-b44fdccf0ea3.png) ![image](https://user-images.githubusercontent.com/64096105/81352211-ab4f8700-90ce-11ea-990d-524c9756addf.png) I am confused which equation can best describe the process. Following are the representation: 1. N is orignal word length 2. M is the BPE word length after tokenization 3. w represents `n_position` size, which is 1024 for GPT-2 pretrained model. 4. i=0 till M I try to make the first equation, as GPT-2 cannot calculate perplexity in one go, if M is greater than w. It needs to calculate mean of cross-entropy loss. Can you please share your opinion in formulating an equation?
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4219/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4219/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4218
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4218/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4218/comments
https://api.github.com/repos/huggingface/transformers/issues/4218/events
https://github.com/huggingface/transformers/pull/4218
614,387,362
MDExOlB1bGxSZXF1ZXN0NDE0OTU0NjU0
4,218
feat(Trainer): log epoch and final metrics
{ "login": "borisdayma", "id": 715491, "node_id": "MDQ6VXNlcjcxNTQ5MQ==", "avatar_url": "https://avatars.githubusercontent.com/u/715491?v=4", "gravatar_id": "", "url": "https://api.github.com/users/borisdayma", "html_url": "https://github.com/borisdayma", "followers_url": "https://api.github.com/users/borisdayma/followers", "following_url": "https://api.github.com/users/borisdayma/following{/other_user}", "gists_url": "https://api.github.com/users/borisdayma/gists{/gist_id}", "starred_url": "https://api.github.com/users/borisdayma/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/borisdayma/subscriptions", "organizations_url": "https://api.github.com/users/borisdayma/orgs", "repos_url": "https://api.github.com/users/borisdayma/repos", "events_url": "https://api.github.com/users/borisdayma/events{/privacy}", "received_events_url": "https://api.github.com/users/borisdayma/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "^^ I borked your PR unfortunately (💩). Sorry about that. Care to open a new one?\r\n\r\n(same for #4211)", "Sure, no worry!" ]
1,588
1,588
1,588
CONTRIBUTOR
null
This PR adds new logging capabilities to `Trainer`: * logs epoch -> this let us compare runs with different batch sizes, using "epoch" as the x-axis instead of "global_step" * logs final metrics -> metrics are also logged by `Trainer.evaluate` at the end of the script (or at the start if we just use `--do_eval` and not train). In below example, we see `epoch` has been used for x-axis and `eval_loss` has one extra point corresponding to the end of the script. ![image](https://user-images.githubusercontent.com/715491/81350982-d57e5600-9088-11ea-8ce6-400bda09bea7.png)
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4218/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4218/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4218", "html_url": "https://github.com/huggingface/transformers/pull/4218", "diff_url": "https://github.com/huggingface/transformers/pull/4218.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4218.patch", "merged_at": null }
https://api.github.com/repos/huggingface/transformers/issues/4217
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4217/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4217/comments
https://api.github.com/repos/huggingface/transformers/issues/4217/events
https://github.com/huggingface/transformers/pull/4217
614,372,160
MDExOlB1bGxSZXF1ZXN0NDE0OTQyMzA5
4,217
[Pipeline, Generation] tf generation pipeline bug
{ "login": "patrickvonplaten", "id": 23423619, "node_id": "MDQ6VXNlcjIzNDIzNjE5", "avatar_url": "https://avatars.githubusercontent.com/u/23423619?v=4", "gravatar_id": "", "url": "https://api.github.com/users/patrickvonplaten", "html_url": "https://github.com/patrickvonplaten", "followers_url": "https://api.github.com/users/patrickvonplaten/followers", "following_url": "https://api.github.com/users/patrickvonplaten/following{/other_user}", "gists_url": "https://api.github.com/users/patrickvonplaten/gists{/gist_id}", "starred_url": "https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/patrickvonplaten/subscriptions", "organizations_url": "https://api.github.com/users/patrickvonplaten/orgs", "repos_url": "https://api.github.com/users/patrickvonplaten/repos", "events_url": "https://api.github.com/users/patrickvonplaten/events{/privacy}", "received_events_url": "https://api.github.com/users/patrickvonplaten/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "# [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4217?src=pr&el=h1) Report\n> Merging [#4217](https://codecov.io/gh/huggingface/transformers/pull/4217?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/transformers/commit/8bf7312654d40cea1a399e86f9fe8e39e1ea3a1e&el=desc) will **increase** coverage by `0.00%`.\n> The diff coverage is `100.00%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/huggingface/transformers/pull/4217/graphs/tree.svg?width=650&height=150&src=pr&token=9qOlN6Hb1c)](https://codecov.io/gh/huggingface/transformers/pull/4217?src=pr&el=tree)\n\n```diff\n@@ Coverage Diff @@\n## master #4217 +/- ##\n=======================================\n Coverage 78.38% 78.39% \n=======================================\n Files 120 120 \n Lines 19916 19918 +2 \n=======================================\n+ Hits 15611 15614 +3 \n+ Misses 4305 4304 -1 \n```\n\n\n| [Impacted Files](https://codecov.io/gh/huggingface/transformers/pull/4217?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [src/transformers/pipelines.py](https://codecov.io/gh/huggingface/transformers/pull/4217/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9waXBlbGluZXMucHk=) | `76.36% <100.00%> (+0.09%)` | :arrow_up: |\n| [src/transformers/modeling\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4217/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ191dGlscy5weQ==) | `90.96% <0.00%> (-0.13%)` | :arrow_down: |\n| [src/transformers/modeling\\_tf\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4217/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9tb2RlbGluZ190Zl91dGlscy5weQ==) | `92.93% <0.00%> (+0.16%)` | :arrow_up: |\n| [src/transformers/file\\_utils.py](https://codecov.io/gh/huggingface/transformers/pull/4217/diff?src=pr&el=tree#diff-c3JjL3RyYW5zZm9ybWVycy9maWxlX3V0aWxzLnB5) | `74.38% <0.00%> (+0.41%)` | :arrow_up: |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/transformers/pull/4217?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/huggingface/transformers/pull/4217?src=pr&el=footer). Last update [8bf7312...0e6bf4e](https://codecov.io/gh/huggingface/transformers/pull/4217?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n", "^^ I borked your PR unfortunately, @patrickvonplaten (me = 💩). Sorry about that. Care to open a new one?", "(or commit your change directly as others have approved)", "No worries, I used my bullet proof manual rebase of copy-paste files :D. \r\n\r\nThis looks good to me. Can you check quickly and merge? @julien-c " ]
1,588
1,589
1,588
MEMBER
null
Generation can currently not be used for TF due to a small bug. This PR fixes it and adds tests. I will update the usage docs and pipeline notebook tomorrow.
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4217/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4217/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4217", "html_url": "https://github.com/huggingface/transformers/pull/4217", "diff_url": "https://github.com/huggingface/transformers/pull/4217.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4217.patch", "merged_at": 1588941006000 }
https://api.github.com/repos/huggingface/transformers/issues/4216
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4216/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4216/comments
https://api.github.com/repos/huggingface/transformers/issues/4216/events
https://github.com/huggingface/transformers/pull/4216
614,353,774
MDExOlB1bGxSZXF1ZXN0NDE0OTI3NjIx
4,216
[examples/summarization] run_train_tiny.sh: remove unused kwarg
{ "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "I borked your PR unfortunately (💩). Sorry about that. Care to open a new one?" ]
1,588
1,588
1,588
CONTRIBUTOR
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4216/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4216/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4216", "html_url": "https://github.com/huggingface/transformers/pull/4216", "diff_url": "https://github.com/huggingface/transformers/pull/4216.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4216.patch", "merged_at": null }
https://api.github.com/repos/huggingface/transformers/issues/4215
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4215/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4215/comments
https://api.github.com/repos/huggingface/transformers/issues/4215/events
https://github.com/huggingface/transformers/pull/4215
614,275,239
MDExOlB1bGxSZXF1ZXN0NDE0ODY0MDU2
4,215
Examples readme.md
{ "login": "julien-c", "id": 326577, "node_id": "MDQ6VXNlcjMyNjU3Nw==", "avatar_url": "https://avatars.githubusercontent.com/u/326577?v=4", "gravatar_id": "", "url": "https://api.github.com/users/julien-c", "html_url": "https://github.com/julien-c", "followers_url": "https://api.github.com/users/julien-c/followers", "following_url": "https://api.github.com/users/julien-c/following{/other_user}", "gists_url": "https://api.github.com/users/julien-c/gists{/gist_id}", "starred_url": "https://api.github.com/users/julien-c/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/julien-c/subscriptions", "organizations_url": "https://api.github.com/users/julien-c/orgs", "repos_url": "https://api.github.com/users/julien-c/repos", "events_url": "https://api.github.com/users/julien-c/events{/privacy}", "received_events_url": "https://api.github.com/users/julien-c/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[]
1,588
1,588
1,588
MEMBER
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4215/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4215/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4215", "html_url": "https://github.com/huggingface/transformers/pull/4215", "diff_url": "https://github.com/huggingface/transformers/pull/4215.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4215.patch", "merged_at": 1588878007000 }
https://api.github.com/repos/huggingface/transformers/issues/4214
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4214/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4214/comments
https://api.github.com/repos/huggingface/transformers/issues/4214/events
https://github.com/huggingface/transformers/issues/4214
614,252,770
MDU6SXNzdWU2MTQyNTI3NzA=
4,214
[examples] text_classification/run_pl.sh error
{ "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false }
[ { "id": 1108649053, "node_id": "MDU6TGFiZWwxMTA4NjQ5MDUz", "url": "https://api.github.com/repos/huggingface/transformers/labels/Help%20wanted", "name": "Help wanted", "color": "008672", "default": false, "description": "Extra attention is needed, help appreciated" }, { "id": 1936351150, "node_id": "MDU6TGFiZWwxOTM2MzUxMTUw", "url": "https://api.github.com/repos/huggingface/transformers/labels/Examples", "name": "Examples", "color": "d4c5f9", "default": false, "description": "Which is related to examples in general" } ]
closed
false
{ "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false }
[ { "login": "sshleifer", "id": 6045025, "node_id": "MDQ6VXNlcjYwNDUwMjU=", "avatar_url": "https://avatars.githubusercontent.com/u/6045025?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sshleifer", "html_url": "https://github.com/sshleifer", "followers_url": "https://api.github.com/users/sshleifer/followers", "following_url": "https://api.github.com/users/sshleifer/following{/other_user}", "gists_url": "https://api.github.com/users/sshleifer/gists{/gist_id}", "starred_url": "https://api.github.com/users/sshleifer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sshleifer/subscriptions", "organizations_url": "https://api.github.com/users/sshleifer/orgs", "repos_url": "https://api.github.com/users/sshleifer/repos", "events_url": "https://api.github.com/users/sshleifer/events{/privacy}", "received_events_url": "https://api.github.com/users/sshleifer/received_events", "type": "User", "site_admin": false } ]
[ "I encountered this bug", "Removing the `test_end` method in `BaseTransformer` (file: https://github.com/huggingface/transformers/blob/master/examples/lightning_base.py) solved the issue for me.\r\n\r\nFrom my understanding, what is happening here is that at the end of testing, `test_end` is being called which is just returning `None` and that's why we are getting the error. \r\n\r\n`test_end` is actually deprecated now in favor of `test_epoch_end`. In `run_pl_glue.py` we are using `test_epoch_end` whereas in `lightning_base.py`, we are using `test_end`. So if we have both of them, then I think only `test_end` will be called. So if we just remove it, we will have a call to `test_epoch_end` which will give us the correct result.", "@divkakwani Thank you! Perfect!", "@divkakwani nice catch! Will remove `test_end` from `BaseTransformer` when I submit PR for #4494.", "This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.\n", "It looks like this particular issue has already been fixed (`test_end` is no more in master), not in a PR suggested in https://github.com/huggingface/transformers/issues/4214#issuecomment-632988310, but elsewhere, so this issue can be closed." ]
1,588
1,595
1,595
CONTRIBUTOR
null
```bash cd examples/text-classification ./run_pl.sh ``` trains for 1 epoch, tests 12/13 steps, then fails with the following traceback ```python /home/shleifer/.conda/envs/nb/lib/python3.7/site-packages/pytorch_lightning/utilities/warnings.py:18: UserWarning: The dataloader, test dataloader 0, does not have many workers which may be a bottleneck. Consider increasing the value of the `num_workers` argument` in the `DataLoader` init to improve performance. warnings.warn(*args, **kwargs) Testing: 92%|████████████████████████████████████ | 12/13 [00:00<00:00, 14.67it/s]Traceback (most recent call last): File "run_pl_glue.py", line 195, in <module> trainer.test(model) File "/home/shleifer/.conda/envs/nb/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 894, in test self.fit(model) File "/home/shleifer/.conda/envs/nb/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 704, in fit self.single_gpu_train(model) File "/home/shleifer/.conda/envs/nb/lib/python3.7/site-packages/pytorch_lightning/trainer/distrib_parts.py", line 477, in single_gpu_train self.run_pretrain_routine(model) File "/home/shleifer/.conda/envs/nb/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 819, in run_pretrain_routine self.run_evaluation(test_mode=True) File "/home/shleifer/.conda/envs/nb/lib/python3.7/site-packages/pytorch_lightning/trainer/evaluation_loop.py", line 374, in run_evaluation eval_results) File "/home/shleifer/.conda/envs/nb/lib/python3.7/site-packages/pytorch_lightning/trainer/logging.py", line 107, in process_output for k, v in output.items(): AttributeError: 'NoneType' object has no attribute 'items' File "/home/shleifer/.conda/envs/nb/lib/python3.7/site-packages/pytorch_lightning/trainer/logging.py", line 107, in process_output for k, v in output.items(): AttributeError: 'NoneType' object has no attribute 'items' ```
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4214/reactions", "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4214/timeline
completed
null
null
https://api.github.com/repos/huggingface/transformers/issues/4213
https://api.github.com/repos/huggingface/transformers
https://api.github.com/repos/huggingface/transformers/issues/4213/labels{/name}
https://api.github.com/repos/huggingface/transformers/issues/4213/comments
https://api.github.com/repos/huggingface/transformers/issues/4213/events
https://github.com/huggingface/transformers/pull/4213
614,225,845
MDExOlB1bGxSZXF1ZXN0NDE0ODI0MDI0
4,213
BIG Reorganize examples
{ "login": "julien-c", "id": 326577, "node_id": "MDQ6VXNlcjMyNjU3Nw==", "avatar_url": "https://avatars.githubusercontent.com/u/326577?v=4", "gravatar_id": "", "url": "https://api.github.com/users/julien-c", "html_url": "https://github.com/julien-c", "followers_url": "https://api.github.com/users/julien-c/followers", "following_url": "https://api.github.com/users/julien-c/following{/other_user}", "gists_url": "https://api.github.com/users/julien-c/gists{/gist_id}", "starred_url": "https://api.github.com/users/julien-c/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/julien-c/subscriptions", "organizations_url": "https://api.github.com/users/julien-c/orgs", "repos_url": "https://api.github.com/users/julien-c/repos", "events_url": "https://api.github.com/users/julien-c/events{/privacy}", "received_events_url": "https://api.github.com/users/julien-c/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
[ "Really cool!" ]
1,588
1,588
1,588
MEMBER
null
{ "url": "https://api.github.com/repos/huggingface/transformers/issues/4213/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/transformers/issues/4213/timeline
null
false
{ "url": "https://api.github.com/repos/huggingface/transformers/pulls/4213", "html_url": "https://github.com/huggingface/transformers/pull/4213", "diff_url": "https://github.com/huggingface/transformers/pull/4213.diff", "patch_url": "https://github.com/huggingface/transformers/pull/4213.patch", "merged_at": 1588873725000 }