mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-08-12 10:37:58 +00:00

* replace get_task method and change invocation layer order * add test for invocation layer order * add test documentation * make invocation layer test more robust * fix type annotation * change hf timeout * simplify timeout mock and add get_task exception cause --------- Co-authored-by: Stefano Fiorucci <44616784+anakin87@users.noreply.github.com>
15 lines
603 B
Python
15 lines
603 B
Python
import pytest
|
|
|
|
from haystack.nodes.prompt.prompt_model import PromptModelInvocationLayer
|
|
from haystack.nodes.prompt.invocation_layer import HFLocalInvocationLayer, HFInferenceEndpointInvocationLayer
|
|
|
|
|
|
@pytest.mark.unit
|
|
def test_invocation_layer_order():
|
|
"""
|
|
Checks that the huggingface invocation layer is checked late because it can timeout/be slow to respond.
|
|
"""
|
|
last_invocation_layers = set(PromptModelInvocationLayer.invocation_layer_providers[-5:])
|
|
assert HFLocalInvocationLayer in last_invocation_layers
|
|
assert HFInferenceEndpointInvocationLayer in last_invocation_layers
|