Skip to content

Commit

Permalink
add test cases for 2dmse
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanLee97 committed Mar 2, 2024
1 parent cf7eeb4 commit 2f0303f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_loadding.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,14 @@ def test_loadding():
assert isinstance(vecs, np.ndarray)
vecs = angle.encode([{'text': 'hello world', 'text': 'hi there👋'}])
assert isinstance(vecs, np.ndarray)


def test_2dmse_loadding():
import numpy as np
from angle_emb import AnglE

angle = AnglE.from_pretrained('WhereIsAI/UAE-Large-V1')
vecs = angle.encode('hello world', layer_index=20)
assert isinstance(vecs, np.ndarray)
vecs = angle.encode(['hello world', 'hi there👋'], layer_index=20, embedding_size=512)
assert isinstance(vecs, np.ndarray)

0 comments on commit 2f0303f

Please sign in to comment.