ddi-fw 0.0.151__py3-none-any.whl → 0.0.152__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.
@@ -35,20 +35,18 @@ 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
-
46
45
  @property
47
- def train_idx_arr(self) -> List | None:
46
+ def train_idx_arr(self) -> List|None:
48
47
  return self._train_idx_arr
49
-
50
48
  @property
51
- def val_idx_arr(self) -> List | None:
49
+ def val_idx_arr(self) -> List|None:
52
50
  return self._val_idx_arr
53
51
 
54
52
  class Config:
@@ -127,15 +125,12 @@ class Pipeline(BaseModel):
127
125
  print(
128
126
  f"Embeddings of {column} are calculated from {vector_db_collection_name}")
129
127
 
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
-
135
128
  # Populate the embedding dictionary with embeddings from the vector database
136
129
  metadatas = dictionary["metadatas"]
137
130
  embeddings = dictionary["embeddings"]
138
-
131
+ if metadatas is None or embeddings is None:
132
+ raise ValueError(
133
+ "The collection does not contain embeddings or metadatas.")
139
134
  for metadata, embedding in zip(metadatas, embeddings):
140
135
  embedding_dict[metadata["type"]
141
136
  ][metadata["id"]].append(embedding)
@@ -189,8 +184,7 @@ class Pipeline(BaseModel):
189
184
  if issubclass(self.dataset_type, TextDatasetMixin):
190
185
  key, value = next(iter(embedding_dict.items()))
191
186
  embedding_size = value[next(iter(value))][0].shape[0]
192
- pooling_strategy = self.embedding_pooling_strategy_type(
193
- ) if self.embedding_pooling_strategy_type else None
187
+ pooling_strategy = self.embedding_pooling_strategy_type() if self.embedding_pooling_strategy_type else None
194
188
 
195
189
  dataset = self.dataset_type(
196
190
  embedding_dict=embedding_dict,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ddi_fw
3
- Version: 0.0.151
3
+ Version: 0.0.152
4
4
  Summary: Do not use :)
5
5
  Author-email: Kıvanç Bayraktar <bayraktarkivanc@gmail.com>
6
6
  Maintainer-email: Kıvanç Bayraktar <bayraktarkivanc@gmail.com>
@@ -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=NPew1lESAiuXUKR4Ob9R4LwRh2Xe1qfnqZDfmuMuC7k,11253
91
+ ddi_fw/pipeline/pipeline.py,sha256=l-T-QnR_cVD590UovmsUlfjivaaZih7j_KMIJvGDAtA,11073
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.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,,
100
+ ddi_fw-0.0.152.dist-info/METADATA,sha256=Uueb3soUc8ep8pcrJ-VN7PFP7pmSIfJ25QkpwGUKUcs,2082
101
+ ddi_fw-0.0.152.dist-info/WHEEL,sha256=DK49LOLCYiurdXXOXwGJm6U4DkHkg4lcxjhqwRa0CP4,91
102
+ ddi_fw-0.0.152.dist-info/top_level.txt,sha256=PMwHICFZTZtcpzQNPV4UQnfNXYIeLR_Ste-Wfc1h810,7
103
+ ddi_fw-0.0.152.dist-info/RECORD,,