Spaces:
Paused
Paused
Download scratch/check_workflows.py from 3SCError404/miracle: direct link, hf CLI and curl.
- Browser
- Download file 858 Bytes
-
https://huggingface.co/spaces/3SCError404/miracle/resolve/main/scratch/check_workflows.py
- Command line
-
hf download hf://spaces/3SCError404/miracle/scratch/check_workflows.py
-
curl -L -o check_workflows.py https://huggingface.co/spaces/3SCError404/miracle/resolve/main/scratch/check_workflows.py
858 Bytes
| import asyncio | |
| import sys | |
| if sys.platform == 'win32': | |
| asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) | |
| from sqlalchemy import select | |
| from core.database import async_session_factory | |
| from models.ai_workflow import AIWorkflow | |
| async def check_workflows(): | |
| async with async_session_factory() as session: | |
| stmt = select(AIWorkflow).order_by(AIWorkflow.created_at.desc()).limit(10) | |
| result = await session.execute(stmt) | |
| workflows = result.scalars().all() | |
| if not workflows: | |
| print("No workflows found.") | |
| return | |
| for w in workflows: | |
| step_names = [s.get("name") for s in w.steps] if w.steps else [] | |
| print(f"ID: {w.id}, WS: {w.workspace_id}, Type: {w.workflow_type}, Steps: {step_names}") | |
| if __name__ == "__main__": | |
| asyncio.run(check_workflows()) | |