mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-02 03:07:59 +08:00
zhipu embedding token method (#1976)
Co-authored-by: jyong <jyong@dify.ai>
This commit is contained in:
parent
5b24d7129e
commit
60ee98f578
@ -55,7 +55,7 @@ class ZhipuAITextEmbeddingModel(_CommonZhipuaiAI, TextEmbeddingModel):
|
||||
|
||||
total_num_tokens = 0
|
||||
for text in texts:
|
||||
total_num_tokens += len(_get_token_ids_default_method(text))
|
||||
total_num_tokens += self._get_num_tokens_by_gpt2(text)
|
||||
|
||||
return total_num_tokens
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user