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

Error - benchllm with Azure OpenAi service #10

Open
FJLopezGarcia opened this issue Oct 25, 2023 · 2 comments
Open

Error - benchllm with Azure OpenAi service #10

FJLopezGarcia opened this issue Oct 25, 2023 · 2 comments

Comments

@FJLopezGarcia
Copy link

FJLopezGarcia commented Oct 25, 2023

Hello,
I am trying to use benchllm with Azure OpenAi service. I have updated the Chat example you have but I am getting this error:
InvalidRequestError: The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.
image

But sometimes the code works and perfom the evaluation properly:
image

below you have the code I am running. Do you know how to fix it? Thanks!!

`
from dotenv import load_dotenv
import os
import openai
import benchllm
from benchllm.input_types import ChatInput

load_dotenv()

OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
OPENAI_DEPLOYMENT_ENDPOINT = os.getenv("OPENAI_DEPLOYMENT_ENDPOINT")

openai.api_type = "azure"
openai.api_version = "2023-07-01-preview"
openai.api_base = OPENAI_DEPLOYMENT_ENDPOINT
openai.api_key = OPENAI_API_KEY

def chat(messages: ChatInput):
try:
response = openai.ChatCompletion.create(
engine="Chat358K",
messages=messages
)
content = response.choices[0].message.content.strip()
print("Model Response:", content)
return content
except openai.OpenAIError as e:
print("OpenAI Error:", e)
return str(e)

@benchllm.test(suite="./tests")
def gpt_3_5(input: ChatInput):
print("input:", input)
return chat(input)
`

@FJLopezGarcia
Copy link
Author

Do you have any update? Did you have the chance to review this issue? Thanks a lot

@Elio-Khater
Copy link

Hello,
We are trying to connect BenchLLM to Azure Open Ai, and we are encountering the exact same problem that @FJLopezGarcia is facing. Is there any updates on the matter?

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

2 participants