Skip to content

Commit

Permalink
[PPML] Refine get RABIT_TRACKER_IP env in XGBoost examples (#5528)
Browse files Browse the repository at this point in the history
* The original code will lead to keyError if "RABIT_TRACKER_IP" is not
set. The ideal result should be return None.
  • Loading branch information
gc-fu authored Aug 26, 2022
1 parent 061cc39 commit 002df25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ppml/trusted-big-data-ml/python/docker-graphene/tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def start_rabit_tracker(args):

def main():
"""Main function if tracker is executed in standalone mode."""
host_ip = os.environ['RABIT_TRACKER_IP']
host_ip = os.environ.get("RABIT_TRACKER_IP")
if host_ip == None:
sys.stdout.write("###PYTHONWARN### RABIT_TRACKER_IP not set in env")

Expand Down

0 comments on commit 002df25

Please sign in to comment.