fix: baichuan max chunks (#1990)
This commit is contained in:
parent
94626487db
commit
ebd11e7482
2 changed files with 85 additions and 11 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue