examples/demos/yelp_demo/yelp/yelp_sentiment/worker_launcher.sh

14 lines
408 B
Bash
Executable File

#!/bin/bash
# TODO(ankushagarwal): Convert this to a python launcher script
set -x
echo environment
env | sort
WORKER_ID=$(echo ${TF_CONFIG} | jq ".task.index")
WORKER_TYPE=$(echo ${TF_CONFIG} | jq -r ".task.type")
MASTER_INSTANCE=$(echo ${TF_CONFIG} | jq -r ".cluster.${WORKER_TYPE}[${WORKER_ID}]")
t2t-trainer \
--master=grpc://${MASTER_INSTANCE} \
--worker_id=${WORKER_ID} \
--tmp_dir=/tmp \
"$@"