Skip to content

Commit a112194

Browse files
alicup29claude
andcommitted
fix: add explicit PACKAGE_TYPE::train metadata to training client
Both client-train and client-track now explicitly send package type: - RTCClient sends "PACKAGE_TYPE::train" before file transfer - RTCTrackClient sends "PACKAGE_TYPE::track" before file transfer - Worker explicitly handles both package types This makes the protocol more explicit and consistent rather than relying on implicit default behavior. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3e09a2e commit a112194

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

sleap_RTC/client/client_class.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,12 @@ async def send_client_file(self, file_path: str = None, output_dir: str = ""):
341341
if not Path(file_path).exists():
342342
logging.info("File does not exist.")
343343
return
344-
else:
344+
else:
345345
logging.info(f"Sending {file_path} to worker...")
346346

347+
# Send package type indicator
348+
self.data_channel.send("PACKAGE_TYPE::train")
349+
347350
# Send output directory (where models will be saved).
348351
output_dir = "models"
349352
if self.config_info_list:

sleap_RTC/worker/worker_class.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,10 @@ async def on_message(message):
756756
self.package_type = "track"
757757
logging.info("Received track package (inference mode)")
758758
return
759+
elif "PACKAGE_TYPE::train" in message:
760+
self.package_type = "train"
761+
logging.info("Received train package (training mode)")
762+
return
759763

760764
if message == "END_OF_FILE":
761765
logging.info("End of file transfer received.")

0 commit comments

Comments
 (0)