File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
tests/integrations/huggingface_hub Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 22import pytest
33import responses
44
5- import huggingface_hub
65from huggingface_hub import InferenceClient
76
87import sentry_sdk
98from sentry_sdk .utils import package_version
109
1110from typing import TYPE_CHECKING
1211
12+ try :
13+ from huggingface_hub .utils ._errors import HfHubHTTPError
14+ except ImportError :
15+ from huggingface_hub .errors import HfHubHTTPError
16+
17+
1318if TYPE_CHECKING :
1419 from typing import Any
1520
@@ -465,7 +470,7 @@ def test_chat_completion_api_error(
465470 client = InferenceClient (model = "test-model" )
466471
467472 with sentry_sdk .start_transaction (name = "test" ):
468- with pytest .raises (huggingface_hub . errors . HfHubHTTPError ):
473+ with pytest .raises (HfHubHTTPError ):
469474 client .chat_completion (
470475 messages = [{"role" : "user" , "content" : "Hello!" }],
471476 )
You can’t perform that action at this time.
0 commit comments