ddi-fw 0.0.150__py3-none-any.whl → 0.0.151__py3-none-any.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.
- ddi_fw/pipeline/pipeline.py +16 -10
- {ddi_fw-0.0.150.dist-info → ddi_fw-0.0.151.dist-info}/METADATA +1 -1
- {ddi_fw-0.0.150.dist-info → ddi_fw-0.0.151.dist-info}/RECORD +5 -5
- {ddi_fw-0.0.150.dist-info → ddi_fw-0.0.151.dist-info}/WHEEL +0 -0
- {ddi_fw-0.0.150.dist-info → ddi_fw-0.0.151.dist-info}/top_level.txt +0 -0
ddi_fw/pipeline/pipeline.py
CHANGED
@@ -35,18 +35,20 @@ class Pipeline(BaseModel):
|
|
35
35
|
model: Optional[Any] = None
|
36
36
|
multi_modal: Optional[Any] = None
|
37
37
|
use_mlflow: bool = True
|
38
|
-
_items:List=[]
|
39
|
-
_train_idx_arr:List|None=[]
|
40
|
-
_val_idx_arr:List|None=[]
|
41
|
-
|
38
|
+
_items: List = []
|
39
|
+
_train_idx_arr: List | None = []
|
40
|
+
_val_idx_arr: List | None = []
|
41
|
+
|
42
42
|
@property
|
43
43
|
def items(self) -> List:
|
44
44
|
return self._items
|
45
|
+
|
45
46
|
@property
|
46
|
-
def train_idx_arr(self) -> List|None:
|
47
|
+
def train_idx_arr(self) -> List | None:
|
47
48
|
return self._train_idx_arr
|
49
|
+
|
48
50
|
@property
|
49
|
-
def val_idx_arr(self) -> List|None:
|
51
|
+
def val_idx_arr(self) -> List | None:
|
50
52
|
return self._val_idx_arr
|
51
53
|
|
52
54
|
class Config:
|
@@ -125,12 +127,15 @@ class Pipeline(BaseModel):
|
|
125
127
|
print(
|
126
128
|
f"Embeddings of {column} are calculated from {vector_db_collection_name}")
|
127
129
|
|
130
|
+
# if metadatas == None or embeddings == None:
|
131
|
+
if 'embeddings' not in dictionary or 'metadatas' not in dictionary or not dictionary['embeddings'] or not dictionary['metadatas']:
|
132
|
+
raise ValueError(
|
133
|
+
"The collection does not contain embeddings or metadatas.")
|
134
|
+
|
128
135
|
# Populate the embedding dictionary with embeddings from the vector database
|
129
136
|
metadatas = dictionary["metadatas"]
|
130
137
|
embeddings = dictionary["embeddings"]
|
131
|
-
|
132
|
-
raise ValueError(
|
133
|
-
"The collection does not contain embeddings or metadatas.")
|
138
|
+
|
134
139
|
for metadata, embedding in zip(metadatas, embeddings):
|
135
140
|
embedding_dict[metadata["type"]
|
136
141
|
][metadata["id"]].append(embedding)
|
@@ -184,7 +189,8 @@ class Pipeline(BaseModel):
|
|
184
189
|
if issubclass(self.dataset_type, TextDatasetMixin):
|
185
190
|
key, value = next(iter(embedding_dict.items()))
|
186
191
|
embedding_size = value[next(iter(value))][0].shape[0]
|
187
|
-
pooling_strategy = self.embedding_pooling_strategy_type(
|
192
|
+
pooling_strategy = self.embedding_pooling_strategy_type(
|
193
|
+
) if self.embedding_pooling_strategy_type else None
|
188
194
|
|
189
195
|
dataset = self.dataset_type(
|
190
196
|
embedding_dict=embedding_dict,
|
@@ -88,7 +88,7 @@ ddi_fw/pipeline/__init__.py,sha256=tKDM_rW4vPjlYTeOkNgi9PujDzb4e9O3LK1w5wqnebw,2
|
|
88
88
|
ddi_fw/pipeline/multi_modal_combination_strategy.py,sha256=JSyuP71b1I1yuk0s2ecCJZTtCED85jBtkpwTUxibJvI,1706
|
89
89
|
ddi_fw/pipeline/multi_pipeline.py,sha256=D_BZ3ciHbVGuuB7m7cEmVQHESruh1gqhA-vxCMfNKj0,5407
|
90
90
|
ddi_fw/pipeline/ner_pipeline.py,sha256=q1aKjb54Ra1HzZ7dARvBw6lB37je9R-POEf2h6QT_nU,6018
|
91
|
-
ddi_fw/pipeline/pipeline.py,sha256=
|
91
|
+
ddi_fw/pipeline/pipeline.py,sha256=NPew1lESAiuXUKR4Ob9R4LwRh2Xe1qfnqZDfmuMuC7k,11253
|
92
92
|
ddi_fw/utils/__init__.py,sha256=77563ikqAtdzjjgRlLp5OAsJBbpLA1Cao8iecGaVUXQ,354
|
93
93
|
ddi_fw/utils/enums.py,sha256=19eJ3fX5eRK_xPvkYcukmug144jXPH4X9zQqtsFBj5A,671
|
94
94
|
ddi_fw/utils/json_helper.py,sha256=BVU6wmJgdXPxyqLPu3Ck_9Es5RrP1PDanKvE-OSj1D4,571
|
@@ -97,7 +97,7 @@ ddi_fw/utils/package_helper.py,sha256=erl8_onmhK-41zQoaED2qyDUV9GQxmT9sdoyRp9_q5
|
|
97
97
|
ddi_fw/utils/py7zr_helper.py,sha256=gOqaFIyJvTjUM-btO2x9AQ69jZOS8PoKN0wetYIckJw,4747
|
98
98
|
ddi_fw/utils/utils.py,sha256=szwnxMTDRrZoeNRyDuf3aCbtzriwtaRk4mHSH3asLdA,4301
|
99
99
|
ddi_fw/utils/zip_helper.py,sha256=YRZA4tKZVBJwGQM0_WK6L-y5MoqkKoC-nXuuHK6CU9I,5567
|
100
|
-
ddi_fw-0.0.
|
101
|
-
ddi_fw-0.0.
|
102
|
-
ddi_fw-0.0.
|
103
|
-
ddi_fw-0.0.
|
100
|
+
ddi_fw-0.0.151.dist-info/METADATA,sha256=cTz-LpUrPhCU0uKQ2A9oE3lm5uaI3ra3nFHufSoi8hA,2082
|
101
|
+
ddi_fw-0.0.151.dist-info/WHEEL,sha256=DK49LOLCYiurdXXOXwGJm6U4DkHkg4lcxjhqwRa0CP4,91
|
102
|
+
ddi_fw-0.0.151.dist-info/top_level.txt,sha256=PMwHICFZTZtcpzQNPV4UQnfNXYIeLR_Ste-Wfc1h810,7
|
103
|
+
ddi_fw-0.0.151.dist-info/RECORD,,
|
File without changes
|
File without changes
|