Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
xyang16 committed Jul 8, 2024
1 parent b9de875 commit 52cd931
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions engines/python/setup/djl_python_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def __init__(self, args, service):
os.environ["RANK"] = rank

self.sock_type = args.sock_type
self.sock_name = f"{args.sock_name}.{rank}" if rank else args.sock_name
self.port = args.port
self.service = service
self.device_id = args.device_id
Expand All @@ -56,14 +55,13 @@ def __init__(self, args, service):
if self.sock_type == "unix":
if self.sock_name is None:
raise ValueError("Missing sock-name argument.")
self.sock_name = f"{args.sock_name}.{rank}" if rank else args.sock_name

self.clean_up()
elif self.sock_type == "tcp":
if self.sock_name is None:
raise ValueError("Missing sock-name argument.")
if self.port is None:
raise ValueError("Missing port argument.")
self.port = int(self.port) + int(rank)
self.port = int(self.port) + int(rank) if rank else self.port
else:
raise ValueError(f"Invalid socket-type: {self.sock_type}.")

Expand Down

0 comments on commit 52cd931

Please sign in to comment.