Merge pull request #1446 from jabiinfante/allow_zero_in_embeddings

allow 0 (as integers) when using pre-calculated embeddings in verify
This commit is contained in:
Sefik Ilkin Serengil 2025-02-26 12:09:54 +00:00 committed by GitHub
commit c4a6b78f9e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -141,7 +141,8 @@ def verify(
"""
if isinstance(img_path, list):
# given image is already pre-calculated embedding
if not all(isinstance(dim, float) for dim in img_path):
if not all(isinstance(dim, (float, int)) for dim in img_path):
raise ValueError(
f"When passing img{index}_path as a list,"
" ensure that all its items are of type float."