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/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:95f4793a-504e-64f1-b60a-814b8dcd61fb |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B970:260E1A:41E361:5BC546:696F589A |
| html-safe-nonce | 6d91660bb811b97e2578cc3702db1ce17d7a11d9f8ceccd2598cc72d847d78b4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTcwOjI2MEUxQTo0MUUzNjE6NUJDNTQ2OjY5NkY1ODlBIiwidmlzaXRvcl9pZCI6IjQwODMzOTM3MDQwNzQ2MzEzMjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a7ca53ad41d3aa5ff76840b41f1c6b1c465d6ed3b7f49b1ca61138b48430632b |
| hovercard-subject-tag | pull_request:3108212148 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/files |
| 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 | 49bb2ee76ae1b4ec758faefafda636ff20b05a9708bb290d28422cdf542ae979 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 036f37fe552777ac9c6ee661957f947285aab936 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width