diff --git a/cucyuqing/cmd/embedding.py b/cucyuqing/cmd/embedding.py index 46fd414..3fdd1e6 100644 --- a/cucyuqing/cmd/embedding.py +++ b/cucyuqing/cmd/embedding.py @@ -1,5 +1,7 @@ +import traceback import datetime import asyncio +from sqlalchemy.sql.ddl import exc import tqdm import os from tokenizers import Tokenizer @@ -164,8 +166,12 @@ async def get_embedding_from_cache(hash: str) -> list[float] | None: async def main(): await pool.open() while True: - await do_update() - await asyncio.sleep(60) + try: + await do_update() + except Exception as e: + print(traceback.format_exc()) + finally: + await asyncio.sleep(60) async def do_update(): while True: