code-loader 1.0.64a0__py3-none-any.whl → 1.0.64a1__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.
@@ -181,7 +181,6 @@ class CustomLayerHandler:
181
181
  init_arg_names: List[str]
182
182
  call_arg_names: List[str]
183
183
  use_custom_latent_space: bool = False
184
- build: bool = True
185
184
 
186
185
 
187
186
  @dataclass
@@ -1,4 +1,4 @@
1
- from typing import List, Any, Union
1
+ from typing import List, Any, Union, Optional
2
2
 
3
3
  import numpy as np
4
4
  import numpy.typing as npt
@@ -112,11 +112,12 @@ class LeapText:
112
112
 
113
113
  Example:
114
114
  text_data = ['I', 'ate', 'a', 'banana', '', '', '']
115
- leap_text = LeapText(data=text_data) # Create LeapText object
116
- LeapText(leap_text)
115
+ heatmap = [0.1, 0.3, 0.2, 0.9, 0.0, 0.0, 0.0]
116
+ leap_text = LeapText(data=text_data heatmap=heatmap) # Create LeapText object
117
117
  """
118
118
  data: List[str]
119
119
  type: LeapDataType = LeapDataType.Text
120
+ heatmap: Optional[List[float]] = None
120
121
 
121
122
  def __post_init__(self) -> None:
122
123
  validate_type(self.type, LeapDataType.Text)
@@ -124,6 +125,15 @@ class LeapText:
124
125
  for value in self.data:
125
126
  validate_type(type(value), str)
126
127
 
128
+ if self.heatmap is not None:
129
+ validate_type(type(self.heatmap), list)
130
+ for value in self.heatmap:
131
+ validate_type(type(value), float)
132
+ if len(self.heatmap) != len(self.data):
133
+ raise LeapValidationError(
134
+ f"Heatmap length ({len(self.heatmap)}) must match the number of tokens in `data` ({len(self.data)})."
135
+ )
136
+
127
137
 
128
138
  @dataclass
129
139
  class LeapHorizontalBar:
@@ -339,8 +339,7 @@ class LeapBinder:
339
339
  self.setup_container.metadata.append(MetadataHandler(name, function))
340
340
 
341
341
  def set_custom_layer(self, custom_layer: Type[Any], name: str, inspect_layer: bool = False,
342
- kernel_index: Optional[int] = None, use_custom_latent_space: bool = False,
343
- build=True) -> None:
342
+ kernel_index: Optional[int] = None, use_custom_latent_space: bool = False) -> None:
344
343
  """
345
344
  Set a custom layer for the model.
346
345
 
@@ -370,8 +369,7 @@ class LeapBinder:
370
369
  init_args = inspect.getfullargspec(custom_layer.__init__)[0][1:]
371
370
  call_args = inspect.getfullargspec(custom_layer.call)[0][1:]
372
371
  self.setup_container.custom_layers[name] = CustomLayerHandler(name, custom_layer, init_args, call_args,
373
- use_custom_latent_space=use_custom_latent_space,
374
- build=build)
372
+ use_custom_latent_space=use_custom_latent_space)
375
373
 
376
374
  def check_preprocess(self, preprocess_result: Dict[DataStateEnum, PreprocessResponse]) -> None:
377
375
  preprocess_handler = self.setup_container.preprocess
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: code-loader
3
- Version: 1.0.64a0
3
+ Version: 1.0.64a1
4
4
  Summary:
5
5
  Home-page: https://github.com/tensorleap/code-loader
6
6
  License: MIT
@@ -1,11 +1,11 @@
1
1
  LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
2
2
  code_loader/__init__.py,sha256=6MMWr0ObOU7hkqQKgOqp4Zp3I28L7joGC9iCbQYtAJg,241
3
3
  code_loader/contract/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- code_loader/contract/datasetclasses.py,sha256=embwSUgo7lw9iZj12B2LGxwCKp_9rjsQd7dJEEU0m3Y,6728
4
+ code_loader/contract/datasetclasses.py,sha256=cd6fRDC4XLrJa7PcrzoTPIKtGwFZq09DGwiSC5BSKvk,6705
5
5
  code_loader/contract/enums.py,sha256=6Lo7p5CUog68Fd31bCozIuOgIp_IhSiPqWWph2k3OGU,1602
6
6
  code_loader/contract/exceptions.py,sha256=jWqu5i7t-0IG0jGRsKF4DjJdrsdpJjIYpUkN1F4RiyQ,51
7
7
  code_loader/contract/responsedataclasses.py,sha256=RSx9m_R3LawhK5o1nAcO3hfp2F9oJYtxZr_bpP3bTmw,4005
8
- code_loader/contract/visualizer_classes.py,sha256=iIa_O2rKvPTwN5ILCTZvRpsGYiiFABKdwQwfIXGigDo,11928
8
+ code_loader/contract/visualizer_classes.py,sha256=uK3Wl6_jN40I9jEZPrLd5396XSr9MxzLzAAIY8W80pE,12436
9
9
  code_loader/experiment_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  code_loader/experiment_api/api.py,sha256=a7wh6Hhe7IaVxu46eV2soSz-yxnmXG3ipU1BBtsEAaQ,2493
11
11
  code_loader/experiment_api/cli_config_utils.py,sha256=n6JMyNrquxql3KKxHhAP8jAzezlRT-PV2KWI95kKsm0,1140
@@ -17,13 +17,13 @@ code_loader/experiment_api/types.py,sha256=MY8xFARHwdVA7p4dxyhD60ShmttgTvb4qdp1o
17
17
  code_loader/experiment_api/utils.py,sha256=XZHtxge12TS4H4-8PjV3sKuhp8Ud6ojAiIzTZJEqBqc,3304
18
18
  code_loader/experiment_api/workingspace_config_utils.py,sha256=DLzXQCg4dgTV_YgaSbeTVzq-2ja_SQw4zi7LXwKL9cY,990
19
19
  code_loader/inner_leap_binder/__init__.py,sha256=koOlJyMNYzGbEsoIbXathSmQ-L38N_pEXH_HvL7beXU,99
20
- code_loader/inner_leap_binder/leapbinder.py,sha256=9imkP6H9V0ScAhBaEIXzBpbihK0owHvFHaRQY3Aw9KE,25336
20
+ code_loader/inner_leap_binder/leapbinder.py,sha256=LVzpynjISO-a774flzGt1yAQPsSYNE8B5V58Hacs7bQ,25216
21
21
  code_loader/inner_leap_binder/leapbinder_decorators.py,sha256=AHU88W-UJ5alHOA3pN2oq7lIMiyYWdFSM0BL2WR-FGs,20998
22
22
  code_loader/leaploader.py,sha256=Tpf6A25hYuo4D0umGL3BHNYJhmz_NIwvFveQgAlsSOo,19534
23
23
  code_loader/utils.py,sha256=aw2i_fqW_ADjLB66FWZd9DfpCQ7mPdMyauROC5Nd51I,2197
24
24
  code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
25
  code_loader/visualizers/default_visualizers.py,sha256=VoqO9FN84yXyMjRjHjUTOt2GdTkJRMbHbXJ1cJkREkk,2230
26
- code_loader-1.0.64a0.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
27
- code_loader-1.0.64a0.dist-info/METADATA,sha256=4Vn0r8aZWMWyOrqeHd_Z1LMMVBffRBuz5e06zF2WOUU,851
28
- code_loader-1.0.64a0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
29
- code_loader-1.0.64a0.dist-info/RECORD,,
26
+ code_loader-1.0.64a1.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
27
+ code_loader-1.0.64a1.dist-info/METADATA,sha256=d9JZm1AhWAexNMGsFkcqNbcYQ-xPTg8abDnd6RzRe8Q,851
28
+ code_loader-1.0.64a1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
29
+ code_loader-1.0.64a1.dist-info/RECORD,,