fix keyerror
This commit is contained in:
parent
51881ae39d
commit
a594729d00
|
@ -37,9 +37,9 @@ def format_oai_err(err_msg):
|
||||||
|
|
||||||
|
|
||||||
def validate_oai(parameters):
|
def validate_oai(parameters):
|
||||||
if parameters['temperature'] > 2:
|
if parameters.get('temperature', 0) > 2:
|
||||||
return format_oai_err(f"{parameters['temperature']} is greater than the maximum of 2 - 'temperature'")
|
return format_oai_err(f"{parameters['temperature']} is greater than the maximum of 2 - 'temperature'")
|
||||||
if parameters['temperature'] < 0:
|
if parameters.get('temperature', 0) < 0:
|
||||||
return format_oai_err(f"{parameters['temperature']} less than the minimum of 0 - 'temperature'")
|
return format_oai_err(f"{parameters['temperature']} less than the minimum of 0 - 'temperature'")
|
||||||
|
|
||||||
if parameters.get('top_p', 1) > 2:
|
if parameters.get('top_p', 1) > 2:
|
||||||
|
|
Reference in New Issue