Factor Studios commited on
Commit
3abf206
·
verified ·
1 Parent(s): ab3a38e

Update test_ai_integration.py

Browse files
Files changed (1) hide show
  1. test_ai_integration.py +4 -0
test_ai_integration.py CHANGED
@@ -151,6 +151,10 @@ def test_ai_integration():
151
  trust_remote_code=True
152
  )
153
 
 
 
 
 
154
  # Calculate model size for proper VRAM allocation
155
  model_size = sum(p.numel() * p.element_size() for p in model.parameters())
156
  print(f"Model size: {model_size / (1024**3):.2f} GB")
 
151
  trust_remote_code=True
152
  )
153
 
154
+ # Ensure WebSocket connection is active before proceeding
155
+ if not ai_accelerator_for_loading.storage.wait_for_connection():
156
+ raise RuntimeError("WebSocket connection lost - please retry")
157
+
158
  # Calculate model size for proper VRAM allocation
159
  model_size = sum(p.numel() * p.element_size() for p in model.parameters())
160
  print(f"Model size: {model_size / (1024**3):.2f} GB")