Code Monkey home page Code Monkey logo

nlp-textgeneration's Introduction

nlp-

采用seq2seq架构基于bert实现的文本生成模型, 该项目范式为对于给定文本和一个答案,生成相关的问题

nlp-textgeneration's People

Contributors

fang98525 avatar

Stargazers

 avatar

Watchers

 avatar

nlp-textgeneration's Issues

关于model_NEZHA部分代码

您好,非常感谢您的开源,很开心看到您的项目

我在查看您的代码时,发现有如下调用

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

请帮忙分析下原因,或者麻烦将该部分相关代码也上传下,非常感谢,谢谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.