QwenLM / Qwen2.5-Coder

Qwen2.5-Coder is the code version of Qwen2.5, the large language model series developed by Qwen team, Alibaba Cloud.
2.5k stars 161 forks source link

The generated code has a special mark. <|endoftext|> <|cursor|> #161

Open gaomeng20241028 opened 3 days ago

gaomeng20241028 commented 3 days ago

I use the following template:

prompt_template = "<|fim_prefix|>{prefix}<|fim_suffix|>{suffix}<|fim_middle|>"

cyente commented 3 days ago

you could simply remove the " <|cursor|>" and end the outputs at the "<|endoftext|>" .

By the way, which model you are using? and could you give as an example of this bad case?

gaomeng20241028 commented 2 days ago

you could simply remove the " <|cursor|>" and end the outputs at the "<|endoftext|>" .

By the way, which model you are using? and could you give as an example of this bad case?

this one, qwen2.5-coder:32b-instruct-q8_0. I use the code completion tool tabby to access the model, and the content of code completion includes " <|cursor|>" and "<|endoftext|>"

gaomeng20241028 commented 2 days ago

微信图片_20241114101159

cyente commented 2 days ago

you could simply remove the " <|cursor|>" and end the outputs at the "<|endoftext|>" . By the way, which model you are using? and could you give as an example of this bad case?

this one, qwen2.5-coder:32b-instruct-q8_0. I use the code completion tool tabby to access the model, and the content of code completion includes " <|cursor|>" and "<|endoftext|>"

We recommend using the base model rather than the instruct model for code completion.

cyente commented 2 days ago

微信图片_20241114101159

Where is your input text located in the picture? and where is the output?

gaomeng20241028 commented 1 day ago

微信图片_20241114101159

Where is your input text located in the picture? and where is the output?

Only output is shown here. Input is a comment. Write a quick line.