Преглед на файлове

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

Co-authored-by: 李啸吟 <746963140@qq.com>
lixiaoyin преди 1 година
родител
ревизия
cc277227ad
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  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