Skip to content

Hope to cancel "required_args" mecanism. Upgraded openai-python (v0->v1) refuses argumment "repetition_penalty" #767

@TissueC

Description

@TissueC

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

I notice that about 2 weeks ago vllm has merged pr about adding an argument repetition_penalty aligned with huggingface. (refer to pr 1424)

However, openai-python also graded to v1 several days ago. it refuses the unknown argument repetition_penalty. The following is the detail error.
xxx/examples/openai_chatcompletion_client.py", line 72, in <module> chat_completion = client.chat.completions.create( File "/opt/conda/lib/python3.10/site-packages/openai/_utils/_utils.py", line 299, in wrapper return func(*args, **kwargs) TypeError: Completions.create() got an unexpected keyword argument 'repetition_penalty'

This conflict makes that we can not depend openai library for open-source models and self-defined arguments (much more than repetition_penalty). This library has been factually used in many API-based model deployment library like fastchat and vllm.

I really hope that the required_args can be removed. At least, we can modify its behaviors without modifying the source code of openai-python.

To Reproduce

  1. git clone vllm and setup it.
  2. Make some request using vllm and openai, add arguments repetition_penalty
  3. The error happens.

Code snippets

No response

OS

Linux

Python version

Python v3.10

Library version

openai v1.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions