Skip to content

Commit e1a5bc1

Browse files
Adapt with huggingface_hub change in ChatCompletionInputMessage
1 parent 7dbad3a commit e1a5bc1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/test_base_model.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,18 @@ def test_abstract_model_tokenizer_api(base_model: BaseModel):
5656
encoded = base_model.tok_encode("Hi there!")
5757
assert isinstance(encoded, list) and isinstance(encoded[0], int)
5858

59-
encoded = base_model.tok_encode(ChatCompletionInputMessage("user", "Hi there!"))
60-
assert encoded == base_model.tok_encode([ChatCompletionInputMessage("user", "Hi there!")])
59+
encoded = base_model.tok_encode(ChatCompletionInputMessage(role="user", content="Hi there!"))
60+
assert encoded == base_model.tok_encode([ChatCompletionInputMessage(role="user", content="Hi there!")])
6161
assert isinstance(encoded, list) and isinstance(encoded[0], int)
6262

6363
assert isinstance(
6464
base_model.tok_encode(["Hi there!", "Hello there!"]),
6565
BatchEncoding,
6666
)
6767

68-
assert isinstance(base_model.tok_encode([[ChatCompletionInputMessage("user", "Hi there!")]]), BatchEncoding)
68+
assert isinstance(
69+
base_model.tok_encode([[ChatCompletionInputMessage(role="user", content="Hi there!")]]), BatchEncoding
70+
)
6971

7072

7173
class TestBaseModel:

0 commit comments

Comments
 (0)