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

Is the logprobs of fschat==0.2.36 supported now? #3506

Open
wupaopao123 opened this issue Aug 30, 2024 · 1 comment
Open

Is the logprobs of fschat==0.2.36 supported now? #3506

wupaopao123 opened this issue Aug 30, 2024 · 1 comment

Comments

@wupaopao123
Copy link

I find 45cf5cc

I tried it, but it still returned null.

@wupaopao123
Copy link
Author

wupaopao123 commented Aug 30, 2024

import os
from openai import OpenAI

os.environ["OPENAI_API_BASE"] = "http://xx.xx.xxx.xx:8000/v1"
os.environ['OPENAI_API_KEY'] = 'EMPTY'

client = OpenAI(
    # This is the default and can be omitted
    api_key=os.environ.get("OPENAI_API_KEY"),
    base_url=os.environ.get("OPENAI_API_BASE"),
)

chat_completion = client.chat.completions.create(
    messages=[
        {
            "role": "user",
            "content": "How many countries in the world?",
        }
    ],

    model="Meta-Llama-3-8B-Instruct",
    temperature=0.2,
    logprobs=True
)
print(chat_completion.choices[0].logprobs)

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