corvic-engine 0.3.0rc78__cp38-abi3-win_amd64.whl → 0.3.0rc80__cp38-abi3-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- corvic/engine/_native.pyd +0 -0
- corvic/orm/__init__.py +1 -1
- corvic/orm/_soft_delete.py +5 -0
- corvic/system/__init__.py +0 -2
- corvic/system/_image_embedder.py +39 -3
- corvic/system/in_memory_executor.py +0 -13
- {corvic_engine-0.3.0rc78.dist-info → corvic_engine-0.3.0rc80.dist-info}/METADATA +1 -1
- {corvic_engine-0.3.0rc78.dist-info → corvic_engine-0.3.0rc80.dist-info}/RECORD +10 -10
- {corvic_engine-0.3.0rc78.dist-info → corvic_engine-0.3.0rc80.dist-info}/WHEEL +0 -0
- {corvic_engine-0.3.0rc78.dist-info → corvic_engine-0.3.0rc80.dist-info}/licenses/LICENSE +0 -0
corvic/engine/_native.pyd
CHANGED
Binary file
|
corvic/orm/__init__.py
CHANGED
@@ -139,7 +139,7 @@ class Base(sa_orm.MappedAsDataclass, sa_orm.DeclarativeBase):
|
|
139
139
|
return cls._updated_at
|
140
140
|
|
141
141
|
|
142
|
-
class Org(Base, kw_only=True):
|
142
|
+
class Org(SoftDeleteMixin, Base, kw_only=True):
|
143
143
|
"""An organization is a top-level grouping of resources."""
|
144
144
|
|
145
145
|
__tablename__ = "org"
|
corvic/orm/_soft_delete.py
CHANGED
@@ -81,6 +81,11 @@ class SoftDeleteMixin(sa_orm.MappedAsDataclass):
|
|
81
81
|
return None
|
82
82
|
return self._deleted_at.replace(tzinfo=UTC)
|
83
83
|
|
84
|
+
@deleted_at.inplace.expression
|
85
|
+
@classmethod
|
86
|
+
def _deleted_at_at_expression(cls):
|
87
|
+
return cls._deleted_at
|
88
|
+
|
84
89
|
def reset_delete(self):
|
85
90
|
self._deleted_at = None
|
86
91
|
|
corvic/system/__init__.py
CHANGED
@@ -29,7 +29,6 @@ from corvic.system.client import Client
|
|
29
29
|
from corvic.system.in_memory_executor import (
|
30
30
|
InMemoryExecutionResult,
|
31
31
|
InMemoryExecutor,
|
32
|
-
batch_to_proto_struct, # pyright: ignore[reportDeprecated]
|
33
32
|
get_polars_embedding,
|
34
33
|
get_polars_embedding_length,
|
35
34
|
make_dict_bytes_human_readable,
|
@@ -96,7 +95,6 @@ __all__ = [
|
|
96
95
|
"UmapDimensionReducer",
|
97
96
|
"ValidateFirstExecutor",
|
98
97
|
"VectorSimilarityMetric",
|
99
|
-
"batch_to_proto_struct",
|
100
98
|
"get_polars_embedding",
|
101
99
|
"get_polars_embedding_length",
|
102
100
|
"make_dict_bytes_human_readable",
|
corvic/system/_image_embedder.py
CHANGED
@@ -180,17 +180,53 @@ class Clip(ImageEmbedder):
|
|
180
180
|
)
|
181
181
|
|
182
182
|
|
183
|
+
class SigLIP2(Clip):
|
184
|
+
"""SigLIP2 image embedder."""
|
185
|
+
|
186
|
+
def _load_models(self):
|
187
|
+
from transformers.models.auto.modeling_auto import AutoModel
|
188
|
+
from transformers.models.auto.processing_auto import AutoProcessor
|
189
|
+
from transformers.models.clip import (
|
190
|
+
CLIPModel,
|
191
|
+
CLIPProcessor,
|
192
|
+
)
|
193
|
+
|
194
|
+
model = cast(
|
195
|
+
CLIPModel,
|
196
|
+
AutoModel.from_pretrained( # pyright: ignore[reportUnknownMemberType]
|
197
|
+
pretrained_model_name_or_path="google/siglip2-base-patch16-512",
|
198
|
+
revision="a89f5c5093f902bf39d3cd4d81d2c09867f0724b",
|
199
|
+
device_map="auto",
|
200
|
+
),
|
201
|
+
)
|
202
|
+
processor = cast(
|
203
|
+
CLIPProcessor,
|
204
|
+
AutoProcessor.from_pretrained( # pyright: ignore[reportUnknownMemberType]
|
205
|
+
pretrained_model_name_or_path="google/siglip2-base-patch16-512",
|
206
|
+
revision="a89f5c5093f902bf39d3cd4d81d2c09867f0724b",
|
207
|
+
),
|
208
|
+
)
|
209
|
+
return ClipModels(model=model, processor=processor)
|
210
|
+
|
211
|
+
|
183
212
|
class CombinedImageEmbedder(ImageEmbedder):
|
184
213
|
def __init__(self):
|
185
214
|
self._clip_embedder = Clip()
|
215
|
+
self._siglip2_embedder = SigLIP2()
|
186
216
|
self._random_embedder = RandomImageEmbedder()
|
187
217
|
|
188
218
|
def embed(
|
189
219
|
self, context: EmbedImageContext
|
190
220
|
) -> Ok[EmbedImageResult] | InvalidArgumentError | InternalError:
|
191
|
-
|
192
|
-
|
193
|
-
|
221
|
+
match context.model_name:
|
222
|
+
case "random":
|
223
|
+
return self._random_embedder.embed(context)
|
224
|
+
case "clip":
|
225
|
+
return self._clip_embedder.embed(context)
|
226
|
+
case "siglip2":
|
227
|
+
return self._siglip2_embedder.embed(context)
|
228
|
+
case _:
|
229
|
+
return InvalidArgumentError(f"Unknown model name {context.model_name}")
|
194
230
|
|
195
231
|
async def aembed(
|
196
232
|
self,
|
@@ -18,9 +18,7 @@ import polars.selectors as cs
|
|
18
18
|
import pyarrow as pa
|
19
19
|
import pyarrow.parquet as pq
|
20
20
|
import structlog
|
21
|
-
from google.protobuf import json_format, struct_pb2
|
22
21
|
from more_itertools import flatten
|
23
|
-
from typing_extensions import deprecated
|
24
22
|
|
25
23
|
import corvic.system._column_encoding as column_encoding
|
26
24
|
from corvic import embed, embedding_metric, op_graph, sql
|
@@ -99,17 +97,6 @@ def get_polars_embedding(
|
|
99
97
|
)
|
100
98
|
|
101
99
|
|
102
|
-
@deprecated("use pa_scalar.batch_to_structs instead")
|
103
|
-
def batch_to_proto_struct(batch: pa.RecordBatch) -> list[struct_pb2.Struct]:
|
104
|
-
"""Converts a RecordBatch to protobuf Structs safely."""
|
105
|
-
data = batch.to_pylist()
|
106
|
-
structs = [struct_pb2.Struct() for _ in range(len(data))]
|
107
|
-
for idx, datum in enumerate(data):
|
108
|
-
make_dict_bytes_human_readable(datum)
|
109
|
-
json_format.ParseDict(datum, structs[idx])
|
110
|
-
return structs
|
111
|
-
|
112
|
-
|
113
100
|
def make_list_bytes_human_readable(data: list[Any]) -> None:
|
114
101
|
"""Utility function to cleanup list data types.
|
115
102
|
|
@@ -11,7 +11,7 @@ corvic/embedding_metric/__init__.py,sha256=8a-QKSQNbiksueHk5LdkugjZr6wasP4ff8A-J
|
|
11
11
|
corvic/embedding_metric/embeddings.py,sha256=XCiMzoGdRSmCOJnBDnxm3xlU0L_vrXwUxEjwdMv1FMI,14036
|
12
12
|
corvic/embedding_metric/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
corvic/engine/__init__.py,sha256=XL4Vg7rNcBi29ccVelpeFizR9oJtGYXDn84W9zok9d4,975
|
14
|
-
corvic/engine/_native.pyd,sha256=
|
14
|
+
corvic/engine/_native.pyd,sha256=V8crGQ6LIdFBAZ_TZYIZbv_ULgLHuF8Kll7xPX7ELGE,438272
|
15
15
|
corvic/engine/_native.pyi,sha256=KYMPtvXqHZ-jMgZohLf4se3rr-rBpCihmjANcr6s8ag,1390
|
16
16
|
corvic/engine/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
17
|
corvic/eorm/__init__.py,sha256=b4dFnu4fW7wj3Y0SMNVXOp8KoKOp_HAL4GyDN-S8fOY,13704
|
@@ -42,9 +42,9 @@ corvic/op_graph/row_filters/__init__.py,sha256=1sibH_kLw7t_9bpRccnEGWqdCiN0VaUh9
|
|
42
42
|
corvic/op_graph/row_filters/_jsonlogic.py,sha256=0UdwOZmIGp4yuExHM3qqAnJYmcGv7iuc3vLub3GD-9Y,7685
|
43
43
|
corvic/op_graph/row_filters/_row_filters.py,sha256=p3O7tJbLsy65Vs7shAiDjpdM4RzYA4-fyzwskt15pPk,9469
|
44
44
|
corvic/op_graph/sample_strategy.py,sha256=DrbtJ3ORkIRfyIE_FdlOh_UMnCW_K9jL1LeonVYb3bU,3007
|
45
|
-
corvic/orm/__init__.py,sha256=
|
45
|
+
corvic/orm/__init__.py,sha256=FJIFVj8zOOTz0YR0Moq_lgvnb5yLpWnhuLYNTzZw42o,9023
|
46
46
|
corvic/orm/_proto_columns.py,sha256=tcOu92UjFJFYZLasS6sWJQBDRK26yrnmpTii_LDY4iw,913
|
47
|
-
corvic/orm/_soft_delete.py,sha256=
|
47
|
+
corvic/orm/_soft_delete.py,sha256=PpNrWAQaGZhfLOYKgdMvUUcwHyqVtvyiWEg_pratk4o,8048
|
48
48
|
corvic/orm/errors.py,sha256=uFhFXpVG6pby1lndJZHGHxv3Y0Fbt0RiaZ-CqDfuY1o,545
|
49
49
|
corvic/orm/func/__init__.py,sha256=X47bbG7G-rDGmRkEGMq4Vn7mPKePdx724xQIwd_pUc0,471
|
50
50
|
corvic/orm/func/utc_func.py,sha256=-FC6w9wBWXejMv1AICT2Gg7tdkSo7gqL2dFT-YKPGQ4,4518
|
@@ -68,15 +68,15 @@ corvic/result/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
68
68
|
corvic/sql/__init__.py,sha256=kZ1a39KVZ08P8Bg6XuXDLD_dTQX0k620u4nwxZF4SnY,303
|
69
69
|
corvic/sql/parse_ops.py,sha256=5jm2CHycTqzdu9apXTgcvwwyBVpjf7n5waqKfIa84JA,29940
|
70
70
|
corvic/sql/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
71
|
-
corvic/system/__init__.py,sha256=
|
71
|
+
corvic/system/__init__.py,sha256=Qddpk3SoHgoiBJyr9w2bPkp477NZv5MDR8701A17nCY,2697
|
72
72
|
corvic/system/_column_encoding.py,sha256=feSWIv4vKstVq-aavWPk53YucUiq7rZvuyofqTicXBE,7574
|
73
73
|
corvic/system/_dimension_reduction.py,sha256=2tg5SIHY4P480DJQj6PSjW1VgAJCAVJAH8D3BY-ZYXA,2964
|
74
74
|
corvic/system/_embedder.py,sha256=Jr-f4rwNdFRZuMaW-prPCDtjNkkNZVn7zCGMNi_hEYw,5424
|
75
|
-
corvic/system/_image_embedder.py,sha256=
|
75
|
+
corvic/system/_image_embedder.py,sha256=jTuSjxwh8n1peSidKCQFV_LLJDH4XelX9NV4uvGBBtw,11829
|
76
76
|
corvic/system/_planner.py,sha256=ecL-HW8PVz5eWJ1Ktf-RAD2IdZkHu3GuBtXdqElo4ts,8210
|
77
77
|
corvic/system/_text_embedder.py,sha256=NDi--3_tzwIWVImjhFWmp8dHmydGGXNu6GYH8qODsIc,4000
|
78
78
|
corvic/system/client.py,sha256=JcA-fPraqDkl9f8BiClS0qeGY6wzKcEDPymutWrJo54,812
|
79
|
-
corvic/system/in_memory_executor.py,sha256=
|
79
|
+
corvic/system/in_memory_executor.py,sha256=KzX8baGFROpv-5hqVC1qOMf7AlPD22ffYtyBesV-W-M,66076
|
80
80
|
corvic/system/op_graph_executor.py,sha256=tSKro-yb_y1_sgajZluM-6FCvDqO1oUPsiWw2DRxyMQ,3641
|
81
81
|
corvic/system/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
82
82
|
corvic/system/staging.py,sha256=K5P5moiuAMfPx7lxK4mArxeURBwKoyB6x9HGu9JJ16E,1846
|
@@ -94,9 +94,9 @@ corvic/version/__init__.py,sha256=JlkRLvKXsu3zIxhdynO_0Ub5NfQOvGjfwCRkNnaOu9U,11
|
|
94
94
|
corvic/version/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
95
95
|
corvic/well_known_types/__init__.py,sha256=Btbeqieik2AcmijeOXeqBptzueBpgNitvH9J5VNm12w,1289
|
96
96
|
corvic/well_known_types/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
97
|
-
corvic_engine-0.3.
|
98
|
-
corvic_engine-0.3.
|
99
|
-
corvic_engine-0.3.
|
97
|
+
corvic_engine-0.3.0rc80.dist-info/METADATA,sha256=h5FHy0y1OwCZu1dkPk1gY1Fb60l5z6wMe5DV9qR3aH8,1814
|
98
|
+
corvic_engine-0.3.0rc80.dist-info/WHEEL,sha256=qo08K5WTt1v9liGoFGXfI182ciKs5521XAErJtzFynQ,94
|
99
|
+
corvic_engine-0.3.0rc80.dist-info/licenses/LICENSE,sha256=DSS1OD0oIgssKOmAzkMRBv5jvvVuZQbrIv8lpl9DXY8,1035
|
100
100
|
corvic_generated/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
101
101
|
corvic_generated/algorithm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
102
102
|
corvic_generated/algorithm/graph/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -207,4 +207,4 @@ corvic_generated/status/v1/service_pb2.py,sha256=CKXPX2ahq8O4cFhPpt6wo6l--6VZcgj
|
|
207
207
|
corvic_generated/status/v1/service_pb2.pyi,sha256=iXLR2FOKQJpBgvBzpD2kVwcYOCksP2aRwK4JYaI9CBw,558
|
208
208
|
corvic_generated/status/v1/service_pb2_grpc.py,sha256=y-a5ldrphWlNJW-yKswyjNmXokK4-5bbEEfczjagJHo,2736
|
209
209
|
corvic_generated/status/v1/service_pb2_grpc.pyi,sha256=OoAnaZ64FD0UTzPoRhYvQU8ecoilhHj3ySjSfHbVDaU,1501
|
210
|
-
corvic_engine-0.3.
|
210
|
+
corvic_engine-0.3.0rc80.dist-info/RECORD,,
|
File without changes
|
File without changes
|