-
Notifications
You must be signed in to change notification settings - Fork 38
[Feature] Add BERT SWAG Multiple Choice application (Ref: #ID9IPX) #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
[Feature] Add BERT SWAG Multiple Choice application (Ref: #ID9IPX) #31
Conversation
运行出错:ValueError Traceback (most recent call last) File /usr/local/python3.10.14/lib/python3.10/site-packages/mindtorch/nn/modules/module.py:826, in Module._wrapped_call_impl(self, *args, **kwargs) File /usr/local/python3.10.14/lib/python3.10/site-packages/mindtorch/nn/modules/module.py:840, in Module._call_impl(self, *args, **kwargs) File /usr/local/python3.10.14/lib/python3.10/site-packages/transformers/models/bert/modeling_bert.py:1605, in BertForMultipleChoice.forward(self, input_ids, attention_mask, token_type_ids, position_ids, head_mask, inputs_embeds, labels, output_attentions, output_hidden_states, return_dict) File /usr/local/python3.10.14/lib/python3.10/site-packages/mindtorch/nn/modules/module.py:826, in Module._wrapped_call_impl(self, *args, **kwargs) File /usr/local/python3.10.14/lib/python3.10/site-packages/mindtorch/nn/modules/module.py:840, in Module._call_impl(self, *args, **kwargs) File /usr/local/python3.10.14/lib/python3.10/site-packages/transformers/models/bert/modeling_bert.py:936, in BertModel.forward(self, input_ids, attention_mask, token_type_ids, position_ids, head_mask, inputs_embeds, encoder_hidden_states, encoder_attention_mask, past_key_values, use_cache, output_attentions, output_hidden_states, return_dict, cache_position) File /usr/local/python3.10.14/lib/python3.10/site-packages/mindtorch/nn/modules/module.py:826, in Module._wrapped_call_impl(self, *args, **kwargs) File /usr/local/python3.10.14/lib/python3.10/site-packages/mindtorch/nn/modules/module.py:840, in Module._call_impl(self, *args, **kwargs) File /usr/local/python3.10.14/lib/python3.10/site-packages/transformers/models/bert/modeling_bert.py:179, in BertEmbeddings.forward(self, input_ids, token_type_ids, position_ids, inputs_embeds, past_key_values_length) File /usr/local/python3.10.14/lib/python3.10/site-packages/mindtorch/nn/modules/module.py:826, in Module._wrapped_call_impl(self, *args, **kwargs) File /usr/local/python3.10.14/lib/python3.10/site-packages/mindtorch/nn/modules/module.py:840, in Module._call_impl(self, *args, **kwargs) File /usr/local/python3.10.14/lib/python3.10/site-packages/mindtorch/nn/modules/sparse.py:192, in Embedding.forward(self, input) File /usr/local/python3.10.14/lib/python3.10/site-packages/mindtorch/nn/functional.py:184, in embedding(input, weight, padding_idx, max_norm, norm_type, scale_grad_by_freq, sparse) File /usr/local/python3.10.14/lib/python3.10/site-packages/mindtorch/executor.py:6, in execute(func_name, *args, **kwargs) File /usr/local/python3.10.14/lib/python3.10/site-packages/mindtorch/dispatcher.py:42, in Dispatcher.dispatch(self, func_name, *args, **kwargs) ValueError: All tensor arguments must be on the same device. |
…nto feature/bert-swag-multiple-choice
|
已修复问题并且修改格式,请重写测试。 |
|
MindSpore 2.7.0和MindSpore NLP 0.5.1版本可以运行 |
|
clean and rename SWAG multiple choice notebook |
xing-yiren
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 呃其实这个严格来说应该属于llm领域的,放到llm路径下吧,同步路径改成模型名称,更新下readme
- 多余的这种.ds_Store的Mac上的数据文件删掉
- ipynb内容中涉及MindNLP建议写成MindSpore NLP全名
整体挺好的,赞
|
移动并清理文件[Move BERT SWAG notebook to llm] |
|
我这边没问题了,辛苦 @wang-hua-2019 也把把关 |
Purpose: Added a new NLP application case for Multiple Choice tasks using BERT on the SWAG dataset.
Issue: Ref: #ID9IPX
Approach: Implemented using MindSpore 2.7.1 and Mindhf 0.6.0
Changes
Added applications/nlp/multiple_choice/swag_bert_run_result.ipynb.
Updated applications/nlp/README.md to include the new case in the application list.
Inference demo runs successfully on 910B2.
ref:https://gitee.com/mindspore/community/issues/ID9IPX