gpt-j和gpt-neo产生的句子太长

发布于 2025-02-02 06:32:57 字数 1575 浏览 4 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

微暖i 2025-02-09 06:32:58

使用所有GPT模型,您可以在生成过程中指定“ max_length”参数。这将迫使模型生成等于max_length的代币数量。您也可以使用num_return_ sequences播放,并使用辅助功能选择最短序列。

示例:

output = model.generate(input_ids, do_sample=True, top_k=50, max_length=100, top_p=0.95, num_return_sequences=1)

这些大型语言模型经过大量数据的培训,在学会适应您要喂养的内容时,对它们进行微调可以耐心。尝试不同的事物 - 调整训练数据格式,尝试不同的样本,在一代期间使用预要来指导模型等。词,因此很难预测到底是什么导致它说一件事。

With all GPT models you can specify the "max_length" parameter during generation. This will force the model to generate an amount of tokens equal to max_length. You could also play with num_return_sequences and use a helper function to choose the shortest sequence.

Example:

output = model.generate(input_ids, do_sample=True, top_k=50, max_length=100, top_p=0.95, num_return_sequences=1)

These large language models are trained on massive amounts of data, and fine-tuning them can take patience as they learn to adapt to what you're feeding it. Try different things - adjust your training data format, try different samples, use a pre-prompt during generation to guide the model, etc.. A model like GPT-J does a mind-numbingly large amount of calculations just to spit out a single word, so it is hard to predict what exactly is causing it to say one thing over another.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文