Title: Feat/pgvector numpy support by DavidHein96 · Pull Request #93 · sqlc-dev/sqlc-gen-python · GitHub
Open Graph Title: Feat/pgvector numpy support by DavidHein96 · Pull Request #93 · sqlc-dev/sqlc-gen-python
X Title: Feat/pgvector numpy support by DavidHein96 · Pull Request #93 · sqlc-dev/sqlc-gen-python
Description: This addresses #61 The default format is a a numpy float 32 to match pgvector numpy was chosen over pytorch tensor for the lighter dependencies This might need a special section in the docs though that to actually be able to do this you may need to coerce first to actually ensure the correct form. def _coerce_embedding(x: NDArray[np.floating]) -> NDArray[np.float32]: # pgvector elements are single-precision floats; enforce dtype + 1D arr = np.asarray(x, dtype=np.float32) if arr.ndim != 1: raise ValueError(f"embedding must be 1-D, got shape {arr.shape}") return arr As well as some kind of way of registering pgvector from sqlalchemy import event from pgvector.psycopg import register_vector @event.listens_for(engine, "connect") def _pgvector_connect(dbapi_connection, _): register_vector(dbapi_connection)
Open Graph Description: This addresses #61 The default format is a a numpy float 32 to match pgvector numpy was chosen over pytorch tensor for the lighter dependencies This might need a special section in the docs though...
X Description: This addresses #61 The default format is a a numpy float 32 to match pgvector numpy was chosen over pytorch tensor for the lighter dependencies This might need a special section in the docs though...
Opengraph URL: https://github.com/sqlc-dev/sqlc-gen-python/pull/93
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:8223d330-cc62-e8df-7734-548b59fb69d1 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | C180:33CBA2:91AB7C:CC215B:696F3C83 |
| html-safe-nonce | 8ec6b583a6863e59647e95145174fe004c9bb9b7b258649c0790e8e706a7149b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTgwOjMzQ0JBMjo5MUFCN0M6Q0MyMTVCOjY5NkYzQzgzIiwidmlzaXRvcl9pZCI6IjY5MzAzNTQxMjM4NzgzODI3MjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 592a3956114d7f6d5e8f3dc2e559d576828c3c2183a8d23a0bfa9207d3d02527 |
| hovercard-subject-tag | pull_request:3108212148 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/sqlc-dev/sqlc-gen-python/pull/93/checks |
| twitter:image | https://avatars.githubusercontent.com/u/58490167?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/58490167?s=400&v=4 |
| og:image:alt | This addresses #61 The default format is a a numpy float 32 to match pgvector numpy was chosen over pytorch tensor for the lighter dependencies This might need a special section in the docs though... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee |
| turbo-cache-control | no-preview |
| go-import | github.com/sqlc-dev/sqlc-gen-python git https://github.com/sqlc-dev/sqlc-gen-python.git |
| octolytics-dimension-user_id | 136738596 |
| octolytics-dimension-user_login | sqlc-dev |
| octolytics-dimension-repository_id | 548530161 |
| octolytics-dimension-repository_nwo | sqlc-dev/sqlc-gen-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 548530161 |
| octolytics-dimension-repository_network_root_nwo | sqlc-dev/sqlc-gen-python |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 39aed5006635ab6f45e6b77d23e73b08a00272a3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width