Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repetition penalty passed as frequency penalty in OpenAI-compatible providers #1552

Open
tommasobonomo opened this issue Nov 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tommasobonomo
Copy link

Bug description

I'm setting the repetition penalty parameter to a set value $p$ on a vLLM-deployed model through chat-ui's .env.local. When inspecting vLLM's logs, I find that the repetition penalty is the default value and instead the frequency penalty is set to $p$, the original value I wanted for the repetition penalty.

I found the cause in the codebase:

frequency_penalty: parameters?.repetition_penalty,

According to OpenAI's and vLLM's docs, repetition and frequency penalties have a different scale, although they are conceptually similar. The first has a neutral default value of 1.0, whilst the second has a neutral value of 0.0.

This bug introduces a pretty hefty frequency_penalty = 1.0 when the user has no intention of setting a penalty (repetition_penalty = 1.0).

Steps to reproduce

Deploy a model through any OpenAI-compatible endpoint and set the parameter repetition_penalty = 1.0 in the model parameters in .env.local.

Config

MODELS=`[
    {
	"name":"HuggingFaceTB/SmolLM2-1.7B-Instruct",
        "endpoints": [
            {
                "type":"openai",
                "baseURL":"http://vllm_server:8000/v1",
                "completion":"completions"
            }
        ],
        "parameters": {
            "repetition_penalty": 1.0,
        },
    }
]`

Notes

As noted above, the issue stems from this line in the codebase:

frequency_penalty: parameters?.repetition_penalty,

Repetition and frequency penalty should probably be parsed separately by chat-ui.

@tommasobonomo tommasobonomo added the bug Something isn't working label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant