You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should validate that the model passed is an actual model.
defget_available_models():
response=openai.Model.list()
return [model.idformodelinresponse['data']]
defis_valid_model(model_name):
available_models=get_available_models()
returnmodel_nameinavailable_modelsdefvalidate_model_type(model_name):
if ('davinci'inmodel_nameor'curie'inmodel_name) andis_valid_model(model_name):
return'completion'elif'gpt'inmodel_nameandis_valid_model(model_name):
return'chat completion'else:
raiseException()
....
# Set the parameters for the OpenAI completion APImodel_engine=configs['model'].rstrip('\n')
try:
model_type=validate_model_type(model_engine)
except:
click.echo(f"{RED}FAILED to validate the model name '{model_engine}'. Are you sure this is a valid OpenAI model? Check the available models at <https://platform.openai.com/docs/models/overview> and try again.{RESET}")
return
The text was updated successfully, but these errors were encountered:
We should validate that the model passed is an actual model.
The text was updated successfully, but these errors were encountered: