forked from JDACS4C-IMPROVE/GraphDRP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreprocess.sh
executable file
·56 lines (43 loc) · 1.7 KB
/
preprocess.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
#########################################################################
### THIS IS A TEMPLATE FILE. SUBSTITUTE #PATH# WITH THE MODEL EXECUTABLE.
#########################################################################
# arg 1 CUDA_VISIBLE_DEVICES
# arg 2 CANDLE_DATA_DIR
# arg 3 CANDLE_CONFIG
### Path to your CANDLEized model's main Python script###
#-- CANDLE_MODEL=/usr/local/GraphDRP/graphdrp_baseline_pytorch.py
CANDLE_MODEL=/usr/local/GraphDRP/frm_preprocess.py
if [ $# -lt 2 ] ; then
echo "Illegal number of parameters"
echo "CUDA_VISIBLE_DEVICES and CANDLE_DATA_DIR are required"
exit -1
fi
if [ $# -eq 2 ] ; then
CUDA_VISIBLE_DEVICES=$1 ; shift
CANDLE_DATA_DIR=$1 ; shift
CMD="python ${CANDLE_MODEL}"
echo "CMD = $CMD"
elif [ $# -ge 3 ] ; then
CUDA_VISIBLE_DEVICES=$1 ; shift
CANDLE_DATA_DIR=$1 ; shift
# if original $3 is a file, set candle_config and passthrough $@
if [ -f $CANDLE_DATA_DIR/$1 ] ; then
echo "$CANDLE_DATA_DIR/$1 is a file"
CANDLE_CONFIG=$1 ; shift
CMD="python ${CANDLE_MODEL} --config_file $CANDLE_CONFIG $@"
echo "CMD = $CMD $@"
# else passthrough $@
else
echo "$1 is not a file"
CMD="python ${CANDLE_MODEL} $@"
echo "CMD = $CMD"
fi
fi
# Display runtime arguments
echo "using CUDA_VISIBLE_DEVICES ${CUDA_VISIBLE_DEVICES}"
echo "using CANDLE_DATA_DIR ${CANDLE_DATA_DIR}"
echo "using CANDLE_CONFIG ${CANDLE_CONFIG}"
# Set up environmental variables and execute model
echo "running command ${CMD}"
CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES} CANDLE_DATA_DIR=${CANDLE_DATA_DIR} $CMD