File tree 1 file changed +0
-25
lines changed
test/components/embedders
1 file changed +0
-25
lines changed Original file line number Diff line number Diff line change @@ -317,28 +317,3 @@ async def test_run_async_concurrent_requests(self):
317
317
assert isinstance (result ["embedding" ], list )
318
318
assert all (isinstance (x , float ) for x in result ["embedding" ])
319
319
assert len (result ["embedding" ]) == 384 # MiniLM-L6-v2 has 384 dimensions
320
-
321
- @pytest .mark .integration
322
- @pytest .mark .asyncio
323
- @pytest .mark .skipif (os .environ .get ("HF_API_TOKEN" , "" ) == "" , reason = "HF_API_TOKEN is not set" )
324
- async def test_run_async_error_handling_with_real_api (self ):
325
- """
326
- Integration test that verifies error handling with a real API.
327
- This test requires a valid Hugging Face API token.
328
- """
329
- # Use an invalid model name to trigger an error
330
- invalid_model_name = "invalid-model-name-that-does-not-exist"
331
-
332
- embedder = HuggingFaceAPITextEmbedder (
333
- api_type = HFEmbeddingAPIType .SERVERLESS_INFERENCE_API , api_params = {"model" : invalid_model_name }
334
- )
335
-
336
- # Test with a simple text
337
- text = "This is a test sentence for embedding."
338
-
339
- # The request should fail with an appropriate error
340
- with pytest .raises (Exception ) as excinfo :
341
- await embedder .run_async (text = text )
342
-
343
- # Verify that the error message contains information about the invalid model
344
- assert invalid_model_name in str (excinfo .value ) or "model" in str (excinfo .value ).lower ()
You can’t perform that action at this time.
0 commit comments