BAAI-DCAI / Bunny

A family of lightweight multimodal models.
Apache License 2.0
866 stars 65 forks source link

Repeat Generation #14

Closed pribadihcr closed 4 months ago

pribadihcr commented 6 months ago

With the example parameters some time the generation is repeat. What need to adjust? thanks

# generate
output_ids = model.generate(
    input_ids,
    images=image_tensor,
    max_new_tokens=100,
    use_cache=True)[0]
Isaachhh commented 6 months ago

Could you please share the repeating example? Thanks.

Isaachhh commented 5 months ago

Close the issue for now if there's no further discussions. Feel free to reopen it if there's any other questions.

Gary2018X commented 5 months ago

same question image 提示词: 好奇的用户和人工智能助理之间的聊天。" "你需要对用户的问题给出有用、详细和礼貌的中文回答,如果不确定的不要编造内容,不要回答重复内容。 模型:Bunny-v1_0-2B-zh

Isaachhh commented 5 months ago

The system prompt should be kept as "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions."

I test "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: \<image>\n详细描述一下这张图片。 ASSISTANT:" and get correct feedback.

Gary2018X commented 5 months ago

images_example_1.png is ok but I still repeat using my own image image image result image

image2 image

result2 image

code image

q1: why can not change the system prompt? q2: the max_new_token , I feel like there's a problem with the end of the control output?

Isaachhh commented 5 months ago

I tried image2 (max_new_tokens=500) and got below output by prompt="详细描述一下这张图片。"

这是一张宏伟的美国自由女神像的图片。自由女神像矗立在纽约港,是美国的象征之一。她高耸入云,身着一件绿色的长袍,上面有白色的条纹,仿佛在风中飘舞。女神的左手拿着一本书,右手则拿着一把火炬,仿佛在向世界宣告自由。她的头部和脚部都由铜铸而成,呈现出一种闪闪发光的绿色。女神的脚部还有一块铜板,上面有几个小孔,可能是为了防止雕像在风中摇晃而设计的。 自由女神像的基座是用石头建造的,上面有几块砖,这些砖块的形状和大小都不同。在自由女神像的底部,有一个小洞,可能是为了增加雕像的稳定性而设计的。自由女神像的顶部有一个金色的球,这个球的形状和大小都与自由女神像的头部和脚部相匹配。 自由女神像的背景是一片蔚蓝的天空,天空中没有云彩,只有几颗星星在闪烁。在自由女神像的周围,有几块砖,这些砖块的形状和大小都不同。在自由女神像的底部,有一个小洞,可能是为了增加雕像的稳定性而设计的。 自由女神像的周围还有一些其他的东西,比如一个铜制的火炬,以及一些铜制的装饰品。这些铜制的装饰品和火炬,与自由女神像的铜制部分形成了鲜明的对比。 总的来说,自由女神像是一座非常宏伟的铜制雕像,她高耸入云,身着一件绿色的长袍,左手拿着一本书,右手拿着一把火炬,仿佛在向世界宣告自由。她的基座是用石头建造的,上面有几块砖,这些砖块的形状和大小都不同。自由女神像的背景是一片蔚蓝的天空,天空中没有云彩,只有几颗星星在闪烁。在自由女神像的周围,有几块砖,这些砖块的形状和大小都不同。自由女神像的底部有一个小洞,可能是为了增加雕像的稳定性而设计的。自由女神像的顶部有一个金色的球,这个球的形状和大小都与自由女神像的头部和脚部相匹配。

The Chinese ability is inherited from Qwen1.5-1.8B because we don't add Chinese instruction tuning data when training Bunny-Qwen. So it may be prompt-sensitive.

For Q1, because when training, the system prompt is fixed.

Gary2018X commented 5 months ago

Okay, thank so much

Isaachhh commented 5 months ago

And the model works better when doing Q-A than describling in detail.

Gary2018X commented 5 months ago

image image Why are our results different?😂

Isaachhh commented 5 months ago

Sorry, actually I use "详细描述一下这张图片。"

Gary2018X commented 5 months ago

"详细描述一下这张图片。" get the same result as you did This is too sensitive,😂

Isaachhh commented 4 months ago

Close the issue for now if there's no further discussions. Feel free to reopen it if there's any other questions.