Эх сурвалжийг харах

fix i is not incremented due to violating the uniqueness constraint w… (#771)

Co-authored-by: 李啸吟 <746963140@qq.com>
lixiaoyin 1 жил өмнө
parent
commit
cc277227ad

+ 2 - 2
api/core/embedding/cached_embedding.py

@@ -44,8 +44,8 @@ class CacheEmbedding(Embeddings):
             except:
                 logging.exception('Failed to add embedding to db')
                 continue
-
-            i += 1
+            finally:
+                i += 1
 
         text_embeddings.extend(embedding_results)
         return text_embeddings