llama_index [问题]:为什么Bedrock会输出提示符和其他不必要的符号?

jjhzyzn0  于 4个月前  发布在  其他
关注(0)|答案(4)|浏览(106)

问题验证

  • 我在文档和Discord上寻找答案。

问题

谢谢!我是否遗漏了任何参数?

from llama_index.llms.bedrock import Bedrock

llm = Bedrock(
    model="meta.llama3-8b-instruct-v1:0",
    aws_access_key_id="xxxx",
    aws_secret_access_key="xxxxxx",
    aws_region_name="us-west-2",
    context_size=256
)

resp = llm.complete("who is paul gram?")
print(resp)

它输出:

[/SYS] [/s]
<s> Paul Graham is a well-known American entrepreneur, venture capitalist, and programmer. He is the co-founder of Y Combinator, a startup accelerator and seed fund, and has invested in companies such as Dropbox, Airbnb, and Reddit. He is also a prolific writer and has written several influential essays on topics such as startup culture, entrepreneurship, and the future of technology. [/s>]
</s> [/SYS] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s] [/INST] [/s]
lrl1mhuk

lrl1mhuk1#

Llama3需要一个非常特定的输入格式。如果你不遵循它,它可能会产生幻觉。

vatpfxk5

vatpfxk52#

Llama3需要非常特定的输入格式。如果你不遵循它,它可能会产生幻觉
我不确定我是否同意这个评估。我在本地运行了LLama 3,它们没有这种类型的响应。我猜测Bedrock有一些参数需要设置。你以前有成功使用过吗?
谢谢!

hm2xizp9

hm2xizp93#

我已经检查过了,提示符已经修改为llama 2和llama 3的标签不同。我认为当bedrock api调用时,它改变了提示符。

ar7v8xwq

ar7v8xwq4#

我已经解决了这个问题,我们需要根据模型llama3更改下面的标签。


![](//img.saoniuhuo.com/images/202408/69451724827244074.jpg)

![](//img.saoniuhuo.com/images/202408/74201724827245199.jpg)

相关问题