尝试修复嵌套类名称重复的报错

master
落雨楓 2 years ago
parent 1d898a6c1f
commit 197e3e1f1a

@ -36,16 +36,16 @@ def create_page_index_model(collection_id: int):
if collection_id in page_index_model_list:
return page_index_model_list[collection_id]
else:
class PageIndexModel(AbstractPageIndexModel):
class _PageIndexModel(AbstractPageIndexModel):
__tablename__ = "embedding_search_page_index_%s" % str(collection_id)
embedding_index = sqlalchemy.Index(__tablename__ + "_embedding_idx", AbstractPageIndexModel.embedding,
postgresql_using='ivfflat',
postgresql_ops={'embedding': 'vector_cosine_ops'})
page_index_model_list[collection_id] = PageIndexModel
page_index_model_list[collection_id] = _PageIndexModel
return PageIndexModel
return _PageIndexModel
class PageIndexHelper:
columns = [

Loading…
Cancel
Save