Skip to content

Commit 0544f05

Browse files
codycjymdrxy
andauthored
fix: update dashscope embedding batch size (#165)
According to the official dashscope [documents](https://help.aliyun.com/zh/model-studio/text-embedding-synchronous-api) --------- Co-authored-by: Mason Daugherty <[email protected]>
1 parent 2a832f1 commit 0544f05

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libs/community/langchain_community/embeddings/dashscope.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@
2323

2424
logger = logging.getLogger(__name__)
2525

26-
BATCH_SIZE = {"text-embedding-v1": 25, "text-embedding-v2": 25, "text-embedding-v3": 6}
26+
BATCH_SIZE = {
27+
"text-embedding-v1": 25,
28+
"text-embedding-v2": 25,
29+
"text-embedding-v3": 10,
30+
"text-embedding-v4": 10,
31+
}
2732

2833

2934
def _create_retry_decorator(embeddings: DashScopeEmbeddings) -> Callable[[Any], Any]:

0 commit comments

Comments
 (0)