code-loader 1.0.64a0__tar.gz → 1.0.64a1__tar.gz
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.
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/PKG-INFO +1 -1
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/contract/datasetclasses.py +0 -1
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/contract/visualizer_classes.py +13 -3
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/inner_leap_binder/leapbinder.py +2 -4
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/pyproject.toml +1 -1
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/LICENSE +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/README.md +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/__init__.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/contract/__init__.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/contract/enums.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/contract/exceptions.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/contract/responsedataclasses.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/experiment_api/__init__.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/experiment_api/api.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/experiment_api/cli_config_utils.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/experiment_api/client.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/experiment_api/epoch.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/experiment_api/experiment.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/experiment_api/experiment_context.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/experiment_api/types.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/experiment_api/utils.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/experiment_api/workingspace_config_utils.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/inner_leap_binder/__init__.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/inner_leap_binder/leapbinder_decorators.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/leaploader.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/utils.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/visualizers/__init__.py +0 -0
- {code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/visualizers/default_visualizers.py +0 -0
@@ -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
|
-
|
116
|
-
LeapText(
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/experiment_api/cli_config_utils.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/experiment_api/experiment_context.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/inner_leap_binder/leapbinder_decorators.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{code_loader-1.0.64a0 → code_loader-1.0.64a1}/code_loader/visualizers/default_visualizers.py
RENAMED
File without changes
|