Spaces:
Paused

miracle / scratch /check_embeddings.py
dushyantsingh0
backend stabilization
0529fc2
Raw History Blame Contribute Delete
648 Bytes
import asyncio
import sys
if sys.platform == "win32":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
from core.database import async_session_factory
from sqlalchemy import select, func
from models.ticket import Ticket
async def check():
async with async_session_factory() as db:
res = await db.execute(select(func.count(Ticket.id)).where(Ticket.embedding.is_(None)))
print(f"Tickets without embeddings: {res.scalar()}")
total = await db.execute(select(func.count(Ticket.id)))
print(f"Total tickets: {total.scalar()}")
if __name__ == "__main__":
asyncio.run(check())