AbstractIntegratedModule 1.2.6__tar.gz → 1.2.7__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.
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/AbstractIntegratedModule.egg-info/PKG-INFO +1 -1
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/AbstractIntegratedModule.py +22 -19
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/AbstractOptimizedModules.c +200 -200
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/PKG-INFO +1 -1
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/README.md +5 -2
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/pyproject.toml +1 -1
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/setup.py +1 -1
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/AbstractIntegratedModule.egg-info/SOURCES.txt +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/AbstractIntegratedModule.egg-info/dependency_links.txt +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/AbstractIntegratedModule.egg-info/requires.txt +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/AbstractIntegratedModule.egg-info/top_level.txt +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/AbstractOptimizedModules.pyx +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/MANIFEST.in +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/abstract_model_storage/Cargo.toml +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/abstract_model_storage/pyproject.toml +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/abstract_model_storage/src/lib.rs +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/abstract_model_storage/target/debug/build/libsqlite3-sys-ed07b882cd2aa5e2/out/bindgen.rs +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/abstract_model_storage/target/debug/build/serde_core-ebc15f2e9cad7f5f/out/private.rs +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/abstract_model_storage/target/debug/build/target-lexicon-08527f45de28143d/out/host.rs +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/abstract_model_storage/target/release/build/libsqlite3-sys-bf0400df4523274c/out/bindgen.rs +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/abstract_model_storage/target/release/build/serde_core-5cdb76131825e4af/out/private.rs +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/abstract_model_storage/target/release/build/target-lexicon-43eb95a0588bf457/out/host.rs +0 -0
- {abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/setup.cfg +0 -0
{abstractintegratedmodule-1.2.6 → abstractintegratedmodule-1.2.7}/AbstractIntegratedModule.py
RENAMED
|
@@ -10981,12 +10981,17 @@ class AgentDistributedInference:
|
|
|
10981
10981
|
rules = payload.get('rules')
|
|
10982
10982
|
X = payload.get('X')
|
|
10983
10983
|
y = payload.get('y')
|
|
10984
|
+
|
|
10984
10985
|
|
|
10985
10986
|
# Sanitize if needed
|
|
10986
10987
|
if test_titles:
|
|
10987
10988
|
test_titles = self._sanitize_structured(test_titles)
|
|
10988
10989
|
if label_map:
|
|
10989
10990
|
label_map = self._sanitize_structured(label_map)
|
|
10991
|
+
if label_map is None or not isinstance(label_map, dict):
|
|
10992
|
+
raise ValueError('[>] Label map is None or invalid label map instance!')
|
|
10993
|
+
|
|
10994
|
+
|
|
10990
10995
|
if rules:
|
|
10991
10996
|
rules = self._sanitize_structured(rules)
|
|
10992
10997
|
if X is not None:
|
|
@@ -10994,10 +10999,12 @@ class AgentDistributedInference:
|
|
|
10994
10999
|
if y is not None:
|
|
10995
11000
|
y = self._sanitize_structured(y)
|
|
10996
11001
|
|
|
10997
|
-
if X is None
|
|
10998
|
-
print('[=] Got necessary titles, label_map
|
|
11002
|
+
if X is None and y is None and test_titles is not None and rules is not None:
|
|
11003
|
+
print('[=] Got necessary titles, label_map, rules samples')
|
|
11004
|
+
elif X is not None and y is not None and test_titles is None and rules is None:
|
|
11005
|
+
print('[=] Got necessary titles, rules, label_map, X And Y samples.')
|
|
10999
11006
|
else:
|
|
11000
|
-
|
|
11007
|
+
raise ValueError('[>] All samples are None!')
|
|
11001
11008
|
else:
|
|
11002
11009
|
text = payload.get('text')
|
|
11003
11010
|
if text:
|
|
@@ -11008,9 +11015,8 @@ class AgentDistributedInference:
|
|
|
11008
11015
|
text = str(payload) if payload else None
|
|
11009
11016
|
|
|
11010
11017
|
if not text and not test_titles:
|
|
11011
|
-
print('[
|
|
11012
|
-
|
|
11013
|
-
|
|
11018
|
+
print('[INFO] No text or test_titles in message payload.')
|
|
11019
|
+
|
|
11014
11020
|
# Run the actual prediction
|
|
11015
11021
|
print(f'[=] Initiating prediction method')
|
|
11016
11022
|
try:
|
|
@@ -13342,16 +13348,16 @@ class IntegratedPipeline:
|
|
|
13342
13348
|
if value.shape[0] != num_classes and \
|
|
13343
13349
|
(value.ndim < 2 or value.shape[1] != num_classes):
|
|
13344
13350
|
return (True,
|
|
13345
|
-
f"Array shape {value.shape} doesn't match "
|
|
13351
|
+
f"[>] Array shape {value.shape} doesn't match "
|
|
13346
13352
|
f"{num_classes} classes in key '{key}'",
|
|
13347
13353
|
"Hybrid feature stored incorrectly, clear entry")
|
|
13348
13354
|
if value.size == 0:
|
|
13349
13355
|
return (True,
|
|
13350
|
-
f"Empty array in key '{key}'",
|
|
13356
|
+
f"[>] Empty array in key '{key}'",
|
|
13351
13357
|
"Corrupted array, clear entry")
|
|
13352
13358
|
if not np.isfinite(value).all():
|
|
13353
13359
|
return (True,
|
|
13354
|
-
f"NaN/Inf values in array at key '{key}'",
|
|
13360
|
+
f"[>] NaN/Inf values in array at key '{key}'",
|
|
13355
13361
|
"Corrupted values, clear entry")
|
|
13356
13362
|
|
|
13357
13363
|
# validate tuple values in dict
|
|
@@ -13361,10 +13367,10 @@ class IntegratedPipeline:
|
|
|
13361
13367
|
)
|
|
13362
13368
|
if corrupted:
|
|
13363
13369
|
return (True,
|
|
13364
|
-
f"Corrupted tuple value at key '{key}': {reason}",
|
|
13370
|
+
f"[>] Corrupted tuple value at key '{key}': {reason}",
|
|
13365
13371
|
fix)
|
|
13366
13372
|
|
|
13367
|
-
return (False, "Valid dict structure", None)
|
|
13373
|
+
return (False, "[>] Valid dict structure", None)
|
|
13368
13374
|
|
|
13369
13375
|
|
|
13370
13376
|
def initialize_fitting(self, text):
|
|
@@ -13383,23 +13389,22 @@ class IntegratedPipeline:
|
|
|
13383
13389
|
unique_in_batch = len(np.unique(y_raw))
|
|
13384
13390
|
|
|
13385
13391
|
if num_classes is None:
|
|
13386
|
-
# no model exists
|
|
13392
|
+
# no model exists — this is the legitimate case where
|
|
13387
13393
|
# inferring from y_raw is correct (e.g. first-time initialization)
|
|
13388
13394
|
num_classes = unique_in_batch
|
|
13389
13395
|
print(f'[=] No existing model — initializing with {num_classes} classes '
|
|
13390
13396
|
f'from this batch')
|
|
13391
13397
|
elif unique_in_batch > num_classes:
|
|
13392
|
-
# batch contains
|
|
13393
|
-
#
|
|
13398
|
+
# batch contains more classes than the model supports
|
|
13399
|
+
# a problem — can't onehot-encode into a smaller space
|
|
13394
13400
|
print(f'[⚠️] Batch contains {unique_in_batch} unique classes but model '
|
|
13395
13401
|
f'only supports {num_classes} — expanding to {unique_in_batch}')
|
|
13396
13402
|
num_classes = unique_in_batch
|
|
13397
13403
|
elif unique_in_batch < num_classes:
|
|
13398
13404
|
# batch just doesn't happen to contain all classes.
|
|
13399
|
-
# use
|
|
13405
|
+
# use model's full num_classes so onehot stays the right width
|
|
13400
13406
|
print(f'[=] Batch only contains {unique_in_batch}/{num_classes} classes '
|
|
13401
13407
|
f'— using full model class count for onehot width')
|
|
13402
|
-
# num_classes stays as the model's true value, no change needed
|
|
13403
13408
|
|
|
13404
13409
|
y_onehot = np.zeros((len(y_raw), num_classes))
|
|
13405
13410
|
|
|
@@ -13410,9 +13415,7 @@ class IntegratedPipeline:
|
|
|
13410
13415
|
else:
|
|
13411
13416
|
print(f'[⚠️] Label {label_idx} out of range for {num_classes} classes '
|
|
13412
13417
|
f'at sample {idx} — skipping onehot assignment')
|
|
13413
|
-
|
|
13414
|
-
# silently assigning to a wrong class
|
|
13415
|
-
|
|
13418
|
+
|
|
13416
13419
|
return y_onehot
|
|
13417
13420
|
|
|
13418
13421
|
|