mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
fix: change return value to float when using cache
This commit is contained in:
parent
32ebea91ff
commit
8934ce2fd5
|
@ -102,7 +102,8 @@ class CacheEmbedding(Embeddings):
|
||||||
embedding = redis_client.get(embedding_cache_key)
|
embedding = redis_client.get(embedding_cache_key)
|
||||||
if embedding:
|
if embedding:
|
||||||
redis_client.expire(embedding_cache_key, 600)
|
redis_client.expire(embedding_cache_key, 600)
|
||||||
return list(np.frombuffer(base64.b64decode(embedding), dtype="float"))
|
decoded_embedding = np.frombuffer(base64.b64decode(embedding), dtype="float")
|
||||||
|
return [float(x) for x in decoded_embedding]
|
||||||
try:
|
try:
|
||||||
embedding_result = self._model_instance.invoke_text_embedding(
|
embedding_result = self._model_instance.invoke_text_embedding(
|
||||||
texts=[text], user=self._user, input_type=EmbeddingInputType.QUERY
|
texts=[text], user=self._user, input_type=EmbeddingInputType.QUERY
|
||||||
|
|
Loading…
Reference in New Issue
Block a user