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

OpenAIStreamError: logprobs, best_of and echo parameters are not available on gpt-35-turbo model. #307

Closed
younes-io opened this issue Jan 9, 2024 · 0 comments

Comments

@younes-io
Copy link

younes-io commented Jan 9, 2024

I run this code:

import lmql

llm: lmql.LLM = lmql.model(
    # the name of your deployed model/engine, e.g. 'my-model'
    lmql_model,
    # model="gpt-3.5-turbo",
    api_type='azure', 
    api_base=open_ai_base, 
    api_key=openai_api_key,
    api_version=openai_api_version,
    tokenizer="openai/gpt-3.5-turbo",
    # verbose=True,
)

@lmql.query(model=llm, verbose=True)
def chain_of_thought(question):
    '''lmql
    argmax
    # op-level strings are prompts
    "Tell me a joke:\n"

    # use 'where' constraints to control and restrict generation
    "Q:[JOKE]\n" where len(JOKE) < 120 and STOPS_AT(JOKE, "?")

    "A:[PUNCHLINE]\n" where STOPS_AT(PUNCHLINE, "\n") and len(TOKENS(PUNCHLINE)) > 1
    return PUNCHLINE
    '''

print(chain_of_thought('Why are cats selfish?'))

It fails with

OpenAIStreamError: ('logprobs, best_of and echo parameters are not available on gpt-35-turbo model. Please remove the parameter and try again. For more details, see https://go.microsoft.com/fwlink/?linkid=2227346. (after receiving 0 chunks. Current chunk time: 7.081031799316406e-05 Average chunk time: 0.0)', 'Stream duration:', 0.03593730926513672)

According to Azure OpenAI API docs:
image

Is this a bug in the sense that lmql uses it for gpt3.5-turbo or it's more of a limitation ? Or maybe both..

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