fang98525 / nlp-textgeneration Goto Github PK
View Code? Open in Web Editor NEW采用seq2seq架构基于bert实现的文本生成模型, 该项目范式为对于给定文本和一个答案,生成相关的问题
采用seq2seq架构基于bert实现的文本生成模型, 该项目范式为对于给定文本和一个答案,生成相关的问题
您好,非常感谢您的开源,很开心看到您的项目
我在查看您的代码时,发现有如下调用
from NEZHA.model_NEZHA import NEZHAConfig
from NEZHA import NEZHA_utils
鉴于未找到该代码,我认为来源于官方NEZHA,但却未发现,最后在该处找到相关代码示例
问题:
不知道是否找到的代码经过修改还是其他原因,出现报错信息,如下:
0it [00:01, ?it/s]
Traceback (most recent call last):
File "train_fine_tune.py", line 338, in <module>
train(train_iter, dev_iter, config=config)
File "train_fine_tune.py", line 211, in train
_,loss = model(input_ids=input_ids_list, token_type_ids=segment_ids_list, labels=label_ids_list)
File "/home/anaconda3/envs/liubiao/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/liubiao/zhishiku/QA-QG/QG/model.py", line 181, in forward
output_hidden_states=True
File "/home/anaconda3/envs/liubiao/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/liubiao/zhishiku/QA-QG/QG/NEZHA/model_NEZHA.py", line 549, in forward
extended_attention_mask)
File "/home/anaconda3/envs/liubiao/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/liubiao/zhishiku/QA-QG/QG/NEZHA/model_NEZHA.py", line 476, in forward
hidden_states = layer_module(all_encoder_layers[i], attention_mask)
File "/home/anaconda3/envs/liubiao/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/liubiao/zhishiku/QA-QG/QG/NEZHA/model_NEZHA.py", line 458, in forward
attention_output = self.attention(hidden_states, attention_mask)
File "/home/anaconda3/envs/liubiao/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/liubiao/zhishiku/QA-QG/QG/NEZHA/model_NEZHA.py", line 415, in forward
self_output = self.self(input_tensor, attention_mask)
File "/home/anaconda3/envs/liubiao/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/liubiao/zhishiku/QA-QG/QG/NEZHA/model_NEZHA.py", line 371, in forward
attention_probs_t = attention_probs.permute(2, 0, 1, 3)
RuntimeError: number of dims don't match in permute
请帮忙分析下原因,或者麻烦将该部分相关代码也上传下,非常感谢,谢谢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.