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.
3.1k stars 210 forks source link

The model tends to generate a lot of `<fim_pad>` tokens when using the FIM mode for generation. #101

Closed Grey4sh closed 2 months ago

Grey4sh commented 2 months ago

image

cyente commented 2 months ago

you may need to add fim releated tokens into eos_tokens_ids

cyente commented 2 months ago

99 similar issue

Grey4sh commented 2 months ago

I still enconter the same problem after modified config.json and generation_config.json with TGI-2.3.0

cat generation_config.json
{
  "bos_token_id": 151643,
  "eos_token_id": [
    151643,
    151662
  ],

  "max_new_tokens": 2048,
  "transformers_version": "4.45.0.dev0"
}
{
  "architectures": [
    "Qwen2ForCausalLM"
  ],
  "attention_dropout": 0.0,
  "bos_token_id": 151643,
  "eos_token_id": [
    151643,
    151662
  ],

image

hcbr commented 2 months ago

I still enconter the same problem after modified config.json and generation_config.json with TGI-2.3.0

cat generation_config.json
{
  "bos_token_id": 151643,
  "eos_token_id": [
    151643,
    151662
  ],

  "max_new_tokens": 2048,
  "transformers_version": "4.45.0.dev0"
}
{
  "architectures": [
    "Qwen2ForCausalLM"
  ],
  "attention_dropout": 0.0,
  "bos_token_id": 151643,
  "eos_token_id": [
    151643,
    151662
  ],

image

I think you need to add "<|fim_pad|>" to special token.

hcbr commented 2 months ago

image

image you can try like this.

Grey4sh commented 2 months ago

image you can try like this.

Thank you for your detailed response. However, my current requirement is to deploy server-side inference, and I have tried modifying the local model's config, but it hasn't worked.

cyente commented 2 months ago

This issue is being closed due to no response for more than 1 day.