code-loader 0.2.61__py3-none-any.whl → 0.2.63__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.
- code_loader/leaploader.py +31 -18
- {code_loader-0.2.61.dist-info → code_loader-0.2.63.dist-info}/METADATA +3 -4
- {code_loader-0.2.61.dist-info → code_loader-0.2.63.dist-info}/RECORD +5 -5
- {code_loader-0.2.61.dist-info → code_loader-0.2.63.dist-info}/WHEEL +1 -1
- {code_loader-0.2.61.dist-info → code_loader-0.2.63.dist-info}/LICENSE +0 -0
code_loader/leaploader.py
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
import importlib.util
|
2
|
+
import io
|
3
|
+
import sys
|
4
|
+
from contextlib import redirect_stdout
|
2
5
|
from functools import lru_cache
|
3
6
|
from pathlib import Path
|
4
|
-
from typing import Dict, List, Iterable, Any, Union
|
5
|
-
import sys
|
7
|
+
from typing import Dict, List, Iterable, Any, Union, Optional
|
6
8
|
|
7
9
|
import numpy as np
|
8
10
|
import numpy.typing as npt
|
@@ -118,22 +120,33 @@ class LeapLoader:
|
|
118
120
|
test_payloads: List[DatasetTestResultPayload] = []
|
119
121
|
setup_response = None
|
120
122
|
general_error = None
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
123
|
+
stdout_steam = io.StringIO()
|
124
|
+
with redirect_stdout(stdout_steam):
|
125
|
+
try:
|
126
|
+
self.exec_script()
|
127
|
+
preprocess_test_payload = self._check_preprocess()
|
128
|
+
test_payloads.append(preprocess_test_payload)
|
129
|
+
handlers_test_payloads = self._check_handlers()
|
130
|
+
test_payloads.extend(handlers_test_payloads)
|
131
|
+
is_valid = all([payload.is_passed for payload in test_payloads])
|
132
|
+
setup_response = self.get_dataset_setup_response()
|
133
|
+
except DatasetScriptException as e:
|
134
|
+
line_number = get_root_exception_line_number()
|
135
|
+
general_error = f"Something went wrong, {repr(e.__cause__)} line number: {line_number}"
|
136
|
+
is_valid = False
|
137
|
+
except Exception as e:
|
138
|
+
line_number = get_root_exception_line_number()
|
139
|
+
general_error = f"Something went wrong, {repr(e)} line number: {line_number}"
|
140
|
+
is_valid = False
|
141
|
+
|
142
|
+
print_log = stdout_steam.getvalue()
|
143
|
+
if print_log is not None and print_log != "":
|
144
|
+
if general_error is None:
|
145
|
+
general_error = ""
|
146
|
+
else:
|
147
|
+
general_error += "\n\n"
|
148
|
+
general_error += "Print Log:\n"
|
149
|
+
general_error += print_log
|
137
150
|
|
138
151
|
is_valid_for_model = bool(global_leap_binder.setup_container.custom_layers)
|
139
152
|
model_setup = self.get_model_setup_response()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: code-loader
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.63
|
4
4
|
Summary:
|
5
5
|
Home-page: https://github.com/tensorleap/code-loader
|
6
6
|
License: MIT
|
@@ -12,10 +12,9 @@ Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.8
|
13
13
|
Classifier: Programming Language :: Python :: 3.9
|
14
14
|
Classifier: Programming Language :: Python :: 3.10
|
15
|
-
Requires-Dist: leap-model-parser (==0.1.86)
|
16
15
|
Requires-Dist: numpy (>=1.22.3,<2.0.0)
|
17
|
-
Requires-Dist: tensorflow (>=2.11.0,<3.0.0); platform_machine == "x86_64"
|
18
|
-
Requires-Dist: tensorflow-macos (>=2.11.0,<3.0.0); platform_machine == "arm64"
|
16
|
+
Requires-Dist: tensorflow (>=2.11.0,<3.0.0) ; platform_machine == "x86_64"
|
17
|
+
Requires-Dist: tensorflow-macos (>=2.11.0,<3.0.0) ; platform_machine == "arm64"
|
19
18
|
Requires-Dist: typeguard (>=2.13.3,<3.0.0)
|
20
19
|
Project-URL: Repository, https://github.com/tensorleap/code-loader
|
21
20
|
Description-Content-Type: text/markdown
|
@@ -17,13 +17,13 @@ code_loader/helpers/detection/yolo/pytorch_utils.py,sha256=D4Rreaehz3R8YMvLRbPIh
|
|
17
17
|
code_loader/helpers/detection/yolo/utils.py,sha256=eV9-IZhglRNGud1UmSckIuA49WRKJitDQhPKK7iIaBc,6563
|
18
18
|
code_loader/leap_binder/__init__.py,sha256=Oe7DNj6RmgX-tMruOrI7GYvf3SyAnzOxugF2e117_Z8,93
|
19
19
|
code_loader/leap_binder/leapbinder.py,sha256=WjC-UA5xeY9UZtMqJQOxjidlFcWURC9mmy7OrQy1IY0,6692
|
20
|
-
code_loader/leaploader.py,sha256=
|
20
|
+
code_loader/leaploader.py,sha256=2p7db8DPeMUdnf3ptp5WlYYQRE6m4CMF9uLJ9xQS86w,15724
|
21
21
|
code_loader/metrics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
22
|
code_loader/metrics/default_metrics.py,sha256=xtvTskR7LC5pyKSlFcvlyBpFY9TSXNGVAi5taEPSI60,6727
|
23
23
|
code_loader/utils.py,sha256=WUcM97OuxrhfLCRPoH9EbXrxajNpYgX1CTMc3_PXtYU,1736
|
24
24
|
code_loader/visualizers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
25
|
code_loader/visualizers/default_visualizers.py,sha256=HqWx2qfTrroGl2n8Fpmr_4X-rk7tE2oGapjO3gzz4WY,2226
|
26
|
-
code_loader-0.2.
|
27
|
-
code_loader-0.2.
|
28
|
-
code_loader-0.2.
|
29
|
-
code_loader-0.2.
|
26
|
+
code_loader-0.2.63.dist-info/LICENSE,sha256=qIwWjdspQeSMTtnFZBC8MuT-95L02FPvzRUdWFxrwJY,1067
|
27
|
+
code_loader-0.2.63.dist-info/METADATA,sha256=fXPeCm9x-eYgu_4TVN3a_H64OZa4zdG9oouBJI7TQ_k,876
|
28
|
+
code_loader-0.2.63.dist-info/WHEEL,sha256=kLuE8m1WYU0Ig0_YEGrXyTtiJvKPpLpDEiChiNyei5Y,88
|
29
|
+
code_loader-0.2.63.dist-info/RECORD,,
|
File without changes
|