Skip to content

Commit

Permalink
Revert to previous openai version
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelchgz committed Nov 25, 2023
1 parent 549e809 commit 4d8a4f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fastchat/llm_judge/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,16 +408,16 @@ def chat_compeletion_openai(model, conv, temperature, max_tokens, api_dict=None)
for _ in range(API_MAX_RETRY):
try:
messages = conv.to_openai_api_messages()
response = openai.chat.completions.create(
response = openai.ChatCompletion.create(
model=model,
messages=messages,
n=1,
temperature=temperature,
max_tokens=max_tokens,
)
output = response.choices[0].message.content
output = response["choices"][0]["message"]["content"]
break
except openai.OpenAIError as e:
except openai.error.OpenAIError as e:
print(type(e), e)
time.sleep(API_RETRY_SLEEP)

Expand Down

0 comments on commit 4d8a4f8

Please sign in to comment.