24 lines
570 B
Python
24 lines
570 B
Python
"""清理 Milvus 中无效或已废弃的 NL2SQL 向量。"""
|
|
from __future__ import annotations
|
|
|
|
import asyncio
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
|
|
|
from config import database
|
|
from config.database.milvus import client
|
|
from nl2sql.operations import cleanup_invalid_vectors
|
|
|
|
|
|
async def main() -> None:
|
|
try:
|
|
print(f"deleted {await cleanup_invalid_vectors(client())} invalid NL2SQL vectors")
|
|
finally:
|
|
await database.milvus.dispose()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|