in src/alpaca_eval/decoders/openai.py [0:0]
def _get_price_per_token(model, price_per_token=None):
"""Returns the price per token for a given model"""
if price_per_token is not None:
return float(price_per_token)
elif "gpt-4-1106" in model:
return (
0.01 / 1000
) # that's not completely true because decoding is 0.03 but close enough given that most is context
elif "gpt-4" in model:
return (
0.03 / 1000
) # that's not completely true because decoding is 0.06 but close enough given that most is context
elif "gpt-3.5-turbo" in model:
return 0.002 / 1000
elif "text-davinci-003" in model:
return 0.02 / 1000
else:
logging.warning(f"Unknown model {model} for computing price per token.")
return np.nan