Giter VIP home page Giter VIP logo

Comments (8)

920232796 avatar 920232796 commented on May 18, 2024

我这里测试nezha模型没报错呀?加群你私聊我具体解决?群号在readme里面。
text = "达到" while len(text) < 600: text = text + "中的大" with torch.no_grad(): # print(len(text)) print(bert_model.generate(text, beam_size=3))

from bert_seq2seq.

920232796 avatar 920232796 commented on May 18, 2024

不好意思 刚才弄错了, 这个nezha模型 计算相对位置编码的时候,也会传入一个max_length,当前模型设置的是512,你可以针对你的数据,去设置个合适的,比如你句子长度最大600,那你就设置600,目前应该是这样用。
好处就是你设置这个值,不会影响预训练模型参数,所以并不需要重新训练模型。

from bert_seq2seq.

920232796 avatar 920232796 commented on May 18, 2024

image
我这里目前改成了1024。

from bert_seq2seq.

SCU-JJkinging avatar SCU-JJkinging commented on May 18, 2024

请问我调用的时候该怎么设置max_len呢

from bert_seq2seq.

SCU-JJkinging avatar SCU-JJkinging commented on May 18, 2024

我这边点进去,max_position_embeddings=512

from bert_seq2seq.

920232796 avatar 920232796 commented on May 18, 2024

对 就是设置这个。

from bert_seq2seq.

920232796 avatar 920232796 commented on May 18, 2024

这个在计算相对位置编码的时候 也会用到,所以以前默认是512 会报错。

from bert_seq2seq.

SCU-JJkinging avatar SCU-JJkinging commented on May 18, 2024

哥,我成功了!!!感谢哥!!!今日份喜悦

from bert_seq2seq.

Related Issues (20)

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.