Download scripts/sync_trips.py from codeBOKER/whFalsa: direct link, hf CLI and curl.
- Browser
- Download file 915 Bytes
-
https://huggingface.co/spaces/codeBOKER/whFalsa/resolve/76bb2bd409d6486e9e26468d9747916104dbef7b/scripts/sync_trips.py
- Command line
-
hf download hf://spaces/codeBOKER/whFalsa@76bb2bd409d6486e9e26468d9747916104dbef7b/scripts/sync_trips.py
-
curl -L -o sync_trips.py https://huggingface.co/spaces/codeBOKER/whFalsa/resolve/76bb2bd409d6486e9e26468d9747916104dbef7b/scripts/sync_trips.py
915 Bytes
| # يرسل بيانات الرحلات الحية إلى جداول المتجهات في Supabase | |
| import asyncio | |
| import os | |
| import sys | |
| ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| if ROOT_DIR not in sys.path: | |
| sys.path.insert(0, ROOT_DIR) | |
| from app.config import get_settings | |
| from app.database.supabase import SupabaseRepository, create_supabase_client | |
| from app.services.admin_service import AdminService | |
| from app.services.embedding_service import JinaEmbeddingService | |
| async def main() -> None: | |
| settings = get_settings() | |
| repository = SupabaseRepository(await create_supabase_client(settings)) | |
| service = AdminService( | |
| repository=repository, | |
| embeddings=JinaEmbeddingService(settings), | |
| settings=settings, | |
| ) | |
| indexed = await service.sync_trips() | |
| print(f"Indexed {indexed} active trips") | |
| if __name__ == "__main__": | |
| asyncio.run(main()) | |