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

undefined role for google/gemma-2-27b-it #35

Open
hxiaoyang opened this issue Sep 1, 2024 · 0 comments
Open

undefined role for google/gemma-2-27b-it #35

hxiaoyang opened this issue Sep 1, 2024 · 0 comments

Comments

@hxiaoyang
Copy link

hxiaoyang commented Sep 1, 2024

The following code

client.chat.completions.create(
    model="google/gemma-2-27b-it",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Hello!"},
    ],
    logprobs=1,
    echo=1,
    max_tokens=1,
)

returns

ChatCompletionResponse(id='8bc6c9174a58b8b2-AMS', object=<ObjectType.ChatCompletion: 'chat.completion'>, created=1725209701, model='google/gemma-2-27b-it', choices=[ChatCompletionChoicesData(index=0, logprobs=LogprobsPart(tokens=['Hello'], token_logprobs=[-0.40234375], token_ids=[4521]), finish_reason=<FinishReason.Length: 'length'>, message=ChatCompletionMessage(role=<MessageRole.ASSISTANT: 'assistant'>, content='Hello', tool_calls=None), seed=3322723162690559000)], prompt=[PromptPart(text='<bos><start_of_turn>undefined\nYou are a helpful assistant.<end_of_turn>\n<start_of_turn>undefined\nHello!<end_of_turn>\n<|im_start|>model\n', logprobs=LogprobsPart(tokens=['<bos>', '<bos>', '<start_of_turn>', 'undefined', '\n', 'You', ' are', ' a', ' helpful', ' assistant', '.', '<end_of_turn>', '\n', '<start_of_turn>', 'undefined', '\n', 'Hello', '!', '<end_of_turn>', '\n', '<', '|', 'im', '_', 'start', '|>', 'model', '\n'], token_logprobs=[None, -18.25, -21.625, -12.0, -2.046875, -4.90625, -1.1953125, -1.3125, -2.0625, -2.625, -0.46289062, -11.0, -3.78125, -12.375, -14.3125, -5.1875, -5.96875, -0.01574707, -11.5625, -0.0004043579, -14.9375, -5.5625, -4.65625, -0.008972168, -2.015625, -0.0006790161, -17.75, -0.8671875], token_ids=[2, 2, 106, 22175, 108, 2045, 708, 476, 10055, 20409, 235265, 107, 108, 106, 22175, 108, 4521, 235341, 107, 108, 235322, 235371, 571, 235298, 2997, 73786, 2516, 108]))], usage=UsageData(prompt_tokens=28, completion_tokens=1, total_tokens=29))

where the role of each turn is undefined.

This only the case for google/gemma-2-27b-it and not google/gemma-2-9b-it.

Could you look into this? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant