mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-18 00:51:18 +00:00
add simple benchmark for init
This commit is contained in:
parent
46c08d26c3
commit
0ba7d1f8d9
@ -9,6 +9,7 @@ from typing import Any, Dict, List, Literal, Optional, Tuple, Type
|
|||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
from pytest_benchmark.fixture import BenchmarkFixture
|
||||||
from langchain_core.language_models import BaseChatModel
|
from langchain_core.language_models import BaseChatModel
|
||||||
from langchain_core.load import dumpd, load
|
from langchain_core.load import dumpd, load
|
||||||
from langchain_core.runnables import RunnableBinding
|
from langchain_core.runnables import RunnableBinding
|
||||||
@ -850,3 +851,8 @@ class ChatModelUnitTests(ChatModelTests):
|
|||||||
dumpd(model), valid_namespaces=model.get_lc_namespace()[:1]
|
dumpd(model), valid_namespaces=model.get_lc_namespace()[:1]
|
||||||
).dict()
|
).dict()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@pytest.mark.benchmark
|
||||||
|
def test_init_time(self, benchmark: BenchmarkFixture) -> None:
|
||||||
|
|
||||||
|
_ = benchmark(self.chat_model_class, **self.chat_model_params)
|
||||||
|
Loading…
Reference in New Issue
Block a user