Home / Function/ test_initialization_with_pipeline() — langchain Function Reference

test_initialization_with_pipeline() — langchain Function Reference

Architecture documentation for the test_initialization_with_pipeline() function in test_huggingface_pipeline.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  5f6aaea0_ad03_df2b_5d36_2adb586065ea["test_initialization_with_pipeline()"]
  f31955a1_0524_be5f_87e5_aca998c86526["test_huggingface_pipeline.py"]
  5f6aaea0_ad03_df2b_5d36_2adb586065ea -->|defined in| f31955a1_0524_be5f_87e5_aca998c86526
  style 5f6aaea0_ad03_df2b_5d36_2adb586065ea fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/huggingface/tests/unit_tests/test_huggingface_pipeline.py lines 16–24

def test_initialization_with_pipeline(mock_pipeline: MagicMock) -> None:
    """Test initialization with a pipeline object."""
    mock_pipe = MagicMock()
    mock_pipe.model.name_or_path = "mock-model-id"
    mock_pipeline.return_value = mock_pipe

    llm = HuggingFacePipeline(pipeline=mock_pipe)

    assert llm.model_id == "mock-model-id"

Domain

Subdomains

Frequently Asked Questions

What does test_initialization_with_pipeline() do?
test_initialization_with_pipeline() is a function in the langchain codebase, defined in libs/partners/huggingface/tests/unit_tests/test_huggingface_pipeline.py.
Where is test_initialization_with_pipeline() defined?
test_initialization_with_pipeline() is defined in libs/partners/huggingface/tests/unit_tests/test_huggingface_pipeline.py at line 16.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free