如何解决拥抱面部变压器中用于文本生成XLNet,GPT-2的白名单令牌
在有关文本生成(https://huggingface.co/transformers/main_classes/model.html#generative-models)的文档中,可以选择放置
bad_words_ids (List[int],optional) – List of token ids that are not allowed to be generated. In order to get the tokens of the words that should not appear in the generated text,use tokenizer.encode(bad_word,add_prefix_space=True).
是否还可以选择在“ allowed_words_ids”中添加一些内容?这个想法是限制所生成文本的语言。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。