AbstractIntegratedModule 1.0.3__tar.gz → 1.0.4__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.0.3 → abstractintegratedmodule-1.0.4}/AbstractIntegratedModule.egg-info/PKG-INFO +1 -1
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/AbstractIntegratedModule.py +17 -56
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/AbstractOptimizedModules.c +200 -200
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/PKG-INFO +1 -1
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/README.md +4 -4
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/pyproject.toml +1 -1
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/setup.py +1 -1
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/AbstractIntegratedModule.egg-info/SOURCES.txt +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/AbstractIntegratedModule.egg-info/dependency_links.txt +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/AbstractIntegratedModule.egg-info/requires.txt +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/AbstractIntegratedModule.egg-info/top_level.txt +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/AbstractOptimizedModules.pyx +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/MANIFEST.in +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/abstract_model_storage/Cargo.toml +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/abstract_model_storage/pyproject.toml +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/abstract_model_storage/src/lib.rs +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/abstract_model_storage/target/debug/build/libsqlite3-sys-ed07b882cd2aa5e2/out/bindgen.rs +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/abstract_model_storage/target/debug/build/serde_core-ebc15f2e9cad7f5f/out/private.rs +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/abstract_model_storage/target/debug/build/target-lexicon-08527f45de28143d/out/host.rs +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/abstract_model_storage/target/release/build/libsqlite3-sys-bf0400df4523274c/out/bindgen.rs +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/abstract_model_storage/target/release/build/serde_core-5cdb76131825e4af/out/private.rs +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/abstract_model_storage/target/release/build/target-lexicon-43eb95a0588bf457/out/host.rs +0 -0
- {abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/setup.cfg +0 -0
{abstractintegratedmodule-1.0.3 → abstractintegratedmodule-1.0.4}/AbstractIntegratedModule.py
RENAMED
|
@@ -8125,7 +8125,7 @@ class AgentDistributedInference:
|
|
|
8125
8125
|
continue
|
|
8126
8126
|
|
|
8127
8127
|
if message.get('type') == 2: # PREDICT_RESPONSE
|
|
8128
|
-
continue #
|
|
8128
|
+
continue # Skipped
|
|
8129
8129
|
|
|
8130
8130
|
message = self._receive_message(client)
|
|
8131
8131
|
self.temporary_message = message
|
|
@@ -8630,7 +8630,7 @@ class AgentDistributedInference:
|
|
|
8630
8630
|
return response['prediction'], response['text']
|
|
8631
8631
|
return None, None
|
|
8632
8632
|
except Exception as e:
|
|
8633
|
-
print(f"Vote request failed: {e}")
|
|
8633
|
+
print(f"[-] Vote request failed: {e}")
|
|
8634
8634
|
return None, None
|
|
8635
8635
|
|
|
8636
8636
|
def sync_memory_with_agent(self, agent_id, memory_name, timeout=10):
|
|
@@ -17367,7 +17367,7 @@ class PipelinePredictionManager:
|
|
|
17367
17367
|
if 'sec_predicted' in result:
|
|
17368
17368
|
sec_status = ": ✅" if result['sec_predicted'] == result['expected'] else ": ❌"
|
|
17369
17369
|
print(f"[=] Second Expectation: {result['expected']} || Model Answer: {sec_status}")
|
|
17370
|
-
if result['sec_predicted'] == result['expected']:
|
|
17370
|
+
if 'sec_predicted' in result and 'sec_confidence' in result and result['sec_predicted'] == result['expected']:
|
|
17371
17371
|
self.pipeline.accurate_cache_lookup.add_verified(
|
|
17372
17372
|
X_samples, input_ids,
|
|
17373
17373
|
result['sec_predicted'], result['sec_confidence'], result['sec_index'],
|
|
@@ -17734,7 +17734,17 @@ class ConsecutivePeerAgent:
|
|
|
17734
17734
|
print(f'[==] Peer result: {result['prediction']} With Confidence: {result['confidence']}')
|
|
17735
17735
|
|
|
17736
17736
|
if peer_results:
|
|
17737
|
-
best_peer = max(peer_results, key=lambda x: x['confidence'])
|
|
17737
|
+
best_peer = max(peer_results, key=lambda x: x['confidence'])
|
|
17738
|
+
if isinstance(peer_results[0], dict):
|
|
17739
|
+
total_weight = len(peer_addresses) + 1
|
|
17740
|
+
best_result = best_peer.get('prediction')
|
|
17741
|
+
best_confidence = min(best_peer.get('confidence') / total_weight, 1.0)
|
|
17742
|
+
|
|
17743
|
+
print(f"[ConsecutivePeerAgent] Using Ensemble prediction result is: {best_result} || With Confidence: ({best_confidence:.1%})")
|
|
17744
|
+
self.stats['predictions'] += 1
|
|
17745
|
+
|
|
17746
|
+
return best_peer
|
|
17747
|
+
|
|
17738
17748
|
if best_peer['confidence'] > local_result['confidence']:
|
|
17739
17749
|
best_result = best_peer
|
|
17740
17750
|
print(f"[ConsecutivePeerAgent] Using peer result: {best_peer['prediction']} || Confidence: ({best_peer['confidence']:.1%})")
|
|
@@ -18104,7 +18114,7 @@ class CohesiveAgentDeployment:
|
|
|
18104
18114
|
|
|
18105
18115
|
async def _prediction_worker(self, texts: list, api_key: str = None, client_ip: str = None) -> dict:
|
|
18106
18116
|
# Worker function for processing predictions
|
|
18107
|
-
#
|
|
18117
|
+
# runs in a thread pool via asyncio.to_thread
|
|
18108
18118
|
return self.async_manager.predict(
|
|
18109
18119
|
texts=texts,
|
|
18110
18120
|
timeout=self.pipeline.timeout,
|
|
@@ -18340,30 +18350,10 @@ class CohesiveAgentDeployment:
|
|
|
18340
18350
|
sock.close()
|
|
18341
18351
|
|
|
18342
18352
|
|
|
18343
|
-
async def _peer_health_monitor(self):
|
|
18344
|
-
# Monitor peer health and reconnect if needed
|
|
18345
|
-
logger.info("[💓] Peer health monitor started")
|
|
18346
|
-
|
|
18347
|
-
while not self._shutdown_event.is_set():
|
|
18348
|
-
await asyncio.sleep(30)
|
|
18349
|
-
|
|
18350
|
-
try:
|
|
18351
|
-
# Ping all connected peers
|
|
18352
|
-
alive_agents = self.pipeline.distribution.broadcast_ping()
|
|
18353
|
-
logger.info(f"[=+=] Connected peers: {len(alive_agents)}")
|
|
18354
|
-
|
|
18355
|
-
# Reconnect to known peers that went offline
|
|
18356
|
-
for peer_key, peer_info in self._known_peers.items():
|
|
18357
|
-
if not peer_info.get('connected', False):
|
|
18358
|
-
logger.info(f"[==] Attempting to reconnect to {peer_key}")
|
|
18359
|
-
await self._connect_to_peer(peer_info['host'], peer_info['port'])
|
|
18360
|
-
|
|
18361
|
-
except Exception as e:
|
|
18362
|
-
logger.error(f"[❌] Peer health monitor error: {e}")
|
|
18363
|
-
|
|
18364
18353
|
|
|
18365
18354
|
async def _health_monitor(self):
|
|
18366
18355
|
# Background health monitoring
|
|
18356
|
+
print("[💓] Peer health monitor started")
|
|
18367
18357
|
while not self._shutdown_event.is_set():
|
|
18368
18358
|
await asyncio.sleep(30)
|
|
18369
18359
|
|
|
@@ -18719,7 +18709,7 @@ class CohesiveAgentDeployment:
|
|
|
18719
18709
|
if already_connected:
|
|
18720
18710
|
continue
|
|
18721
18711
|
|
|
18722
|
-
# ✅
|
|
18712
|
+
# ✅ 4: Single connection attempt (NO RETRYS)
|
|
18723
18713
|
print(f"[=] Connecting to {peer_key}...")
|
|
18724
18714
|
|
|
18725
18715
|
try:
|
|
@@ -18792,35 +18782,6 @@ class CohesiveAgentDeployment:
|
|
|
18792
18782
|
logger.warning(f"[=-] Peer {agent_id} failed: {e}")
|
|
18793
18783
|
return None
|
|
18794
18784
|
|
|
18795
|
-
def _ensemble_predictions(self, local: dict, peers: list) -> dict:
|
|
18796
|
-
# Combine predictions from multiple agents
|
|
18797
|
-
try:
|
|
18798
|
-
print('[=+=] Initiating Ensemble weighting with: {peers} peers total')
|
|
18799
|
-
votes = defaultdict(float)
|
|
18800
|
-
votes[local.get('prediction', 'unknown')] += local.get('confidence', 0)
|
|
18801
|
-
|
|
18802
|
-
for peer in peers:
|
|
18803
|
-
if peer and isinstance(peer, dict):
|
|
18804
|
-
votes[peer.get('prediction', 'unknown')] += peer.get('confidence', 0)
|
|
18805
|
-
|
|
18806
|
-
best_pred = max(votes.items(), key=lambda x: x[1])
|
|
18807
|
-
|
|
18808
|
-
total_weight = len(peers) + 1
|
|
18809
|
-
return {
|
|
18810
|
-
'prediction': best_pred[0],
|
|
18811
|
-
'confidence': min(best_pred[1] / total_weight, 1.0),
|
|
18812
|
-
'local_prediction': local.get('prediction'),
|
|
18813
|
-
'local_confidence': local.get('confidence'),
|
|
18814
|
-
'peer_count': len(peers),
|
|
18815
|
-
'ensemble_votes': dict(votes)
|
|
18816
|
-
}
|
|
18817
|
-
except Exception as e:
|
|
18818
|
-
print(f'[-] Error in ensemble weighting; {e}, returning local prediction with 0.0 confidence')
|
|
18819
|
-
return {
|
|
18820
|
-
'prediction': local,
|
|
18821
|
-
'confidence': 0.0,
|
|
18822
|
-
'peer_count': 0.0,
|
|
18823
|
-
}
|
|
18824
18785
|
|
|
18825
18786
|
|
|
18826
18787
|
async def predict_batch_async(self, texts: List[str], api_key: str = None, client_ip: str = None) -> List[dict]:
|