fix: reject invalid embedding input containers
This commit is contained in:
@@ -118,3 +118,10 @@ def test_invalid_resource_options_fail_without_loading_optional_dependencies(opt
|
||||
def test_unsupported_checkpoint_format_is_rejected(checkpoint):
|
||||
with pytest.raises(EmbeddingError):
|
||||
replace(SMALL_ZH, checkpoint_format=checkpoint)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("texts", [None, "不能逐字编码的字符串", ("占位",), [None], [" "]])
|
||||
def test_input_shape_and_text_are_validated_before_encoding(texts):
|
||||
provider = object.__new__(LocalEmbeddingProvider)
|
||||
with pytest.raises(EmbeddingError):
|
||||
provider.encode(texts)
|
||||
|
||||
Reference in New Issue
Block a user