-
Notifications
You must be signed in to change notification settings - Fork 195
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
Azure LLM evaluation - Deployment Error #682
Comments
I don't think this is a bug, just looks like a documentation update would be helpful. The Azure OpenAI term "deployment" usually translates to "model" in other frameworks. The following works for me:
|
Hello there. That library seems great, but I still face issues when I try to sync with my Azure credentials. None of the relevant comments did help me. Can you please check for any inconsistency? { File ~/miniconda3/envs/eval/lib/python3.9/site-packages/uptrain/framework/evalllm.py:101, in EvalLLM.init(self, settings, openai_api_key) ValueError: OpenAI API Key is invalid" |
This is failing when you check for an OpenAI key. The
Needs to also use the AzureOpenAI class to do the check. |
Great, I replaced that part with the corresponding part regarding AzureOpenAI check.
|
@terry07 Could you please help in How you are passing client to EvalLLM class |
I would also appreciate to know how to execute this code properly! |
I'm using the following workaround until this issue is fixed: from uptrain import EvalLLM, Settings
from uptrain.framework.remote import APIClientWithoutAuth
class EvalLLMWorkaround(EvalLLM):
def __init__(self, settings: Settings = None, openai_api_key: str = None) -> None:
if (openai_api_key is None) and (settings is None):
raise Exception('Please provide OpenAI API Key')
if settings is None:
self.settings = Settings(openai_api_key=openai_api_key)
else:
self.settings = settings
self.executor = APIClientWithoutAuth(self.settings)
OPENAI_API_KEY = "sk-********************" # Insert your OpenAI key here
eval_llm = EvalLLMWorkaround(openai_api_key=OPENAI_API_KEY) or from uptrain import EvalLLM, Settings
from uptrain.framework.remote import APIClientWithoutAuth
class EvalLLMWorkaround(EvalLLM):
def __init__(self, settings: Settings) -> None:
self.settings = settings
self.executor = APIClientWithoutAuth(self.settings)
# ... |
azure_endpoint= os.getenv("AZURE_OPENAI_API_BASE")
azure_api_version = os.getenv("OPENAI_API_VERSION")
azure_api_key = os.getenv("AZURE_OPENAI_API_KEY")
from uptrain import EvalLLM, Evals, CritiqueTone, Settings
settings = Settings(model ='azure/{}'.format('AIF_V2'), azure_api_key=azure_api_key, azure_api_version=azure_api_version, azure_api_base=azure_endpoint)
eval_llm = EvalLLM(settings) above code works for me for AzureLLM integration with uptrain |
Describe the bug
Trying to use an Azure API Key to run a LLM evaluation using UpTrain. I received a 404 error message saying that the deployment is not found. However, there is no deployment name parameter when creating the settings for the Eval LLM.
To Reproduce
I followed the steps in this documentation: https://docs.uptrain.ai/llms/azure
Error message:
ERROR | uptrain.operators.language.llm:async_process_payload:103 - Error when sending request to LLM API: Error code: 404 - {'error': {'code': 'DeploymentNotFound', 'message': '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.'}}
The text was updated successfully, but these errors were encountered: