Fix NameError: name 'os' is not defined in cluster_client.py

- Added missing import os at the top of vidai/cluster_client.py
- Removed redundant local import os in _handle_model_transfer_complete function
- This fixes the error when handling master commands on client receiving a job
parent a9a5da9c
...@@ -19,6 +19,7 @@ Cluster client for distributed Video AI processing. ...@@ -19,6 +19,7 @@ Cluster client for distributed Video AI processing.
Connects to cluster master and acts as a bridge for local subprocesses. Connects to cluster master and acts as a bridge for local subprocesses.
""" """
import os
import socket import socket
import json import json
import threading import threading
...@@ -435,7 +436,6 @@ class ClusterClient: ...@@ -435,7 +436,6 @@ class ClusterClient:
if len(model_data) == expected_size: if len(model_data) == expected_size:
# Save the model file # Save the model file
import os
os.makedirs('models', exist_ok=True) os.makedirs('models', exist_ok=True)
model_file = f"models/{model_path.replace('/', '_')}.bin" model_file = f"models/{model_path.replace('/', '_')}.bin"
with open(model_file, 'wb') as f: with open(model_file, 'wb') as f:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment