Skip to content

Commit

Permalink
Merge pull request #315 from leondavi/ModelArgs
Browse files Browse the repository at this point in the history
Model Args - Fixed NerlPlanner Bug
  • Loading branch information
leondavi authored May 6, 2024
2 parents 1af1e80 + 2f6c59a commit ace70cb
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM ubuntu:latest

RUN apt-get update && \
apt-get install -y make gcc g++ libncurses-dev libssl-dev git wget \
python3-venv erlang cmake python3-pip iproute2 zip unzip
erlang cmake python3-pip iproute2 zip unzip

ENV RUNNING_IN_DOCKER=true \
PIP_BREAK_SYSTEM_PACKAGES=1
Expand Down
2 changes: 1 addition & 1 deletion NerlnetInstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ NERLNET_LOG_DIR="/usr/local/lib/nerlnet-lib/log"
REBAR3_FILE=src_erl/rebar3/rebar3
REBAR3_SYMLINK=/usr/local/bin/rebar3

if [[ "$RUNNING_IN_DOCKER" = true ]]; then
if [[ -z "$RUNNING_IN_DOCKER" ]]; then
# Not running inside a docker container
LOGGED_IN_USER=$(logname)
else
Expand Down
3 changes: 2 additions & 1 deletion src_py/nerlPlanner/WinWorkerDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def WinWorkerDialog():
WorkerFileFrame = sg.Frame("File",WorkerFileLayout)

WorkerDefinitionsLayout = [[sg.Text("Model Type: "), sg.Combo(list(ModelTypeMapping.keys()),enable_events=True, key=KEY_MODEL_TYPE_LIST_BOX), sg.Button("LSTM Opts",disabled=True), sg.Button("Layers Sizes Help", enable_events=True, key=KEY_LAYER_SIZES_HELP_BUTTON)],
[sg.Text("Model Args:" , expand_x=True), sg.InputText(key=KEY_MODEL_ARGS_INPUT, enable_events=True, expand_x=True)],
[sg.Text("Model Args:"), sg.InputText(key=KEY_MODEL_ARGS_INPUT, enable_events=True, expand_x=True) , sg.Text("(0)",key=KEY_NUM_OF_MODEL_ARGS)],
[sg.Text("Layers Sizes: Comma separated list, # of neurons in a layer, E.g, 100,80,40,5,1")],
[sg.InputText(key=KEY_LAYER_SIZES_INPUT,enable_events=True, expand_x=True), sg.Text("(0)",key=KEY_NUM_OF_LAYERS_SIZES)],
[sg.Text("List of layers types:"), sg.Combo(list(LayerTypeMap.keys()),key=KEY_LAYER_TYPE_SELECTION), sg.Button("Add",key=KEY_LAYER_TYPE_SELECTION_ADD), sg.Button("Help",key=KEY_LAYER_TYPE_HELP),sg.Button("Clear",key=KEY_LAYER_TYPE_SELECTION_CLEAR)],
Expand Down Expand Up @@ -120,6 +120,7 @@ def ui_update_all_values(WorkerWindow):

if event == KEY_MODEL_ARGS_INPUT:
ModelArgsStr = values[event]
WorkerWindow[KEY_NUM_OF_MODEL_ARGS].update(f'({str(count_str_list_elements(ModelArgsStr))})')

if event == KEY_LAYER_SIZES_HELP_BUTTON:
sg.popup_ok(f"{LAYER_SIZES_HELP_POPUP_STR}", keep_on_top=True, title="Layer Sizes Help")
Expand Down
1 change: 1 addition & 0 deletions src_py/nerlPlanner/WinWorkerDialogDefnitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
KEY_MODEL_TYPE_LIST_BOX = '-MODEL-TYPE-LIST-BOX-'
KEY_MODEL_ARGS_INPUT = '-MODEL-ARGS-INPUT-'

KEY_NUM_OF_MODEL_ARGS = '-NUM-OF-MODEL-ARGS-'
KEY_LAYER_SIZES_INPUT = '-LAYERS-SIZES-INPUT-'
KEY_NUM_OF_LAYERS_SIZES = '-NUM-OF-LAYERS-SIZES-'
KEY_LAYER_TYPE_SELECTION = '-LAYER-TYPE-SELECTION-'
Expand Down
6 changes: 5 additions & 1 deletion tests/NerlnetFullFlowTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ cp $NERLNET_CONFIG_SUBNETS_BACKUP $NERLNET_CONFIG_SUBNETS_DIR
rm $NERLNET_CONFIG_SUBNETS_BACKUP
rm $TEST_DC_JSON

deactivate
if [[ -z "$RUNNING_IN_DOCKER" ]]; then
# not running in docker
deactivate
fi


exit $rc
21 changes: 13 additions & 8 deletions tests/set_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,19 @@ else
fi
}

pip3_installation
virtualenv_installation # must be installed after pip3
unzip_installation
# set python environment to run Nerlnet Flow
print "install virtualenv to $NERLNET_VENV_PATH"
python3 -m virtualenv $NERLNET_VENV_PATH
print "virtualenv is loaded from $NERLNET_VENV_PATH/bin/activate"
source $NERLNET_VENV_PATH/bin/activate
if [[ -z "$RUNNING_IN_DOCKER" ]]; then
# Not running inside a docker container
pip3_installation
virtualenv_installation # must be installed after pip3
unzip_installation
# set python environment to run Nerlnet Flow
print "install virtualenv to $NERLNET_VENV_PATH"
python3 -m virtualenv $NERLNET_VENV_PATH
print "virtualenv is loaded from $NERLNET_VENV_PATH/bin/activate"
source $NERLNET_VENV_PATH/bin/activate
else
print "Skip venv installation when running in docker"
fi

print "pip3 runs in quiet mode"
pip3 -q install -r src_py/requirements.txt

0 comments on commit ace70cb

Please sign in to comment.