Parcourir la source

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

Co-authored-by: 李啸吟 <746963140@qq.com>
lixiaoyin il y a 1 an
Parent
commit
cc277227ad
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      api/core/embedding/cached_embedding.py

+ 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