mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-16 15:04:13 +00:00
community: Update costs of openai finetuned models (#22124)
- **Description:** Update costs of finetuned models and add gpt-3-turbo-0125. Source: https://openai.com/api/pricing/ - **Issue:** N/A - **Dependencies:** None
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from unittest.mock import MagicMock
|
||||
from uuid import uuid4
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
from langchain_core.outputs import LLMResult
|
||||
|
||||
@@ -58,7 +59,7 @@ def test_on_llm_end_custom_model(handler: OpenAICallbackHandler) -> None:
|
||||
("davinci:ft-your-org:custom-model-name-2022-02-15-04-21-04", 0.24),
|
||||
("ft:babbage-002:your-org:custom-model-name:1abcdefg", 0.0032),
|
||||
("ft:davinci-002:your-org:custom-model-name:1abcdefg", 0.024),
|
||||
("ft:gpt-3.5-turbo-0613:your-org:custom-model-name:1abcdefg", 0.028),
|
||||
("ft:gpt-3.5-turbo-0613:your-org:custom-model-name:1abcdefg", 0.009),
|
||||
("babbage-002.ft-0123456789abcdefghijklmnopqrstuv", 0.0008),
|
||||
("davinci-002.ft-0123456789abcdefghijklmnopqrstuv", 0.004),
|
||||
("gpt-35-turbo-0613.ft-0123456789abcdefghijklmnopqrstuv", 0.0035),
|
||||
@@ -79,7 +80,7 @@ def test_on_llm_end_finetuned_model(
|
||||
},
|
||||
)
|
||||
handler.on_llm_end(response)
|
||||
assert handler.total_cost == expected_cost
|
||||
assert np.isclose(handler.total_cost, expected_cost)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
Reference in New Issue
Block a user