From dfd339ca2df61ab405404bba8955ab6fa50d9275 Mon Sep 17 00:00:00 2001 From: Stefano Fiorucci Date: Fri, 18 Oct 2024 10:38:48 +0200 Subject: [PATCH] ensure compatibility with huggingface_hub==0.26.0 (#8464) --- .../notes/compatibility-hh-hub-0.26.0-a5b61f7bf99a97b7.yaml | 4 ++++ test/components/generators/test_hugging_face_api.py | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/compatibility-hh-hub-0.26.0-a5b61f7bf99a97b7.yaml diff --git a/releasenotes/notes/compatibility-hh-hub-0.26.0-a5b61f7bf99a97b7.yaml b/releasenotes/notes/compatibility-hh-hub-0.26.0-a5b61f7bf99a97b7.yaml new file mode 100644 index 0000000000..f12d1c3dc8 --- /dev/null +++ b/releasenotes/notes/compatibility-hh-hub-0.26.0-a5b61f7bf99a97b7.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Adjusted a test on `HuggingFaceAPIGenerator` to ensure compatibility with the `huggingface_hub==0.26.0`. diff --git a/test/components/generators/test_hugging_face_api.py b/test/components/generators/test_hugging_face_api.py index 1754c0d63c..ce6c7ecd22 100644 --- a/test/components/generators/test_hugging_face_api.py +++ b/test/components/generators/test_hugging_face_api.py @@ -250,7 +250,9 @@ def mock_iter(self): index=1, generated_text=None, token=TextGenerationOutputToken(id=1, text="Ok bye", logprob=0.0, special=False), - details=TextGenerationStreamOutputStreamDetails(finish_reason="length", generated_tokens=5, seed=None), + details=TextGenerationStreamOutputStreamDetails( + finish_reason="length", generated_tokens=5, seed=None, input_length=10 + ), ) mock_response = Mock(**{"__iter__": mock_iter})