fix: baichuan max chunks (#1990)
This commit is contained in:
@@ -59,3 +59,40 @@ def test_get_num_tokens():
|
||||
)
|
||||
|
||||
assert num_tokens == 2
|
||||
|
||||
def test_max_chunks():
|
||||
model = BaichuanTextEmbeddingModel()
|
||||
|
||||
result = model.invoke(
|
||||
model='baichuan-text-embedding',
|
||||
credentials={
|
||||
'api_key': os.environ.get('BAICHUAN_API_KEY'),
|
||||
},
|
||||
texts=[
|
||||
"hello",
|
||||
"world",
|
||||
"hello",
|
||||
"world",
|
||||
"hello",
|
||||
"world",
|
||||
"hello",
|
||||
"world",
|
||||
"hello",
|
||||
"world",
|
||||
"hello",
|
||||
"world",
|
||||
"hello",
|
||||
"world",
|
||||
"hello",
|
||||
"world",
|
||||
"hello",
|
||||
"world",
|
||||
"hello",
|
||||
"world",
|
||||
"hello",
|
||||
"world",
|
||||
]
|
||||
)
|
||||
|
||||
assert isinstance(result, TextEmbeddingResult)
|
||||
assert len(result.embeddings) == 22
|
Reference in New Issue
Block a user