Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfeil committed Jun 22, 2024
1 parent 76901c1 commit 3b71a9c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import numpy as np
import requests # type: ignore
import torch
from PIL import Image # type: ignore
Expand All @@ -22,8 +23,11 @@ def test_clip_like_model():
image,
]
embeddings = model.encode_post(model.encode_core(model.encode_pre(inputs)))
assert len(embeddings) == len(inputs)

assert isinstance(embeddings, list)
assert isinstance(embeddings[0], np.ndarray)
assert len(embeddings) == len(inputs)
embeddings = torch.tensor(embeddings)
model = CLIPModel.from_pretrained(model_name)
processor = CLIPProcessor.from_pretrained(model_name)

Expand Down

0 comments on commit 3b71a9c

Please sign in to comment.