Skip to content

Commit d3d97c3

Browse files
committed
scripts now automatically download the models, and small fixes
1 parent 90ba1b4 commit d3d97c3

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

downloaded_models/README.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
When a script (e.g. scripts/predict.sh) automatically downloads a trained model, that model gets stored here.

scripts/predict.sh

+3-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# TODO make this file safe for spaces in filenames
44

55
# default file paths
6-
defaultmodel="example/full_model.tar.gz"
6+
defaultmodel="downloaded_models/full_model.tar.gz"
77
jar="am-tools-all.jar"
88

99
# Documenting parameters:
@@ -60,8 +60,7 @@ if [ -f "$model" ]; then
6060
else
6161
if [ "$model" = "$defaultmodel" ]; then
6262
echo "model not found at default model path. Downloading it!"
63-
# TODO replace this with code that downloads the model from the internet
64-
cp /local/mlinde/am-parser/models/bert_all2/model.tar.gz "$defaultmodel"
63+
wget -O "$defaultmodel" https://coli-saar-data.s3.eu-central-1.amazonaws.com/full_model.tar.gz
6564
else
6665
echo "model not found at $model. Please check the -m parameter"
6766
fi
@@ -71,8 +70,7 @@ if [ -f "$jar" ]; then
7170
echo "jar file found at $jar"
7271
else
7372
echo "jar file not found at $jar, downloading it!"
74-
# TODO replace this with code that downloads the jar file from the internet
75-
cp /proj/irtg.shadow/tools/am-tools-all.jar "$jar"
73+
wget -O "$jar" https://coli-saar-data.s3.eu-central-1.amazonaws.com/am-tools.jar
7674
fi
7775

7876

@@ -106,7 +104,6 @@ if [ "$type" = "DM" ] || [ "$type" = "PAS" ] || [ "$type" = "PSD" ]; then
106104
java -cp $jar de.saar.coli.amrtagging.formalisms.sdp.tools.PrepareFinalTestData -c $input -o $output -p $prefix
107105
else
108106
if [ "$type" = "EDS" ]; then
109-
# TODO fix this part
110107
java -cp $jar de.saar.coli.amrtagging.formalisms.eds.tools.PrepareTestData -c $input -o $output -p $prefix
111108
fi
112109
fi

scripts/predict_from_raw_text.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22

3+
# TODO make this file safe for spaces in filenames
4+
35
# default file paths
4-
defaultmodel="example/raw_text_model.tar.gz"
6+
defaultmodel="downloaded_models/raw_text_model.tar.gz"
57
jar="am-tools-all.jar"
68

79
# Documenting parameters:
@@ -58,8 +60,7 @@ if [ -f "$model" ]; then
5860
else
5961
if [ "$model" = "$defaultmodel" ]; then
6062
echo "model not found at default model path. Downloading it!"
61-
# TODO replace this with code that downloads the model from the internet
62-
cp /local/mlinde/am-parser/models/mtl_bert_minimum/model.tar.gz "$defaultmodel"
63+
wget -O "$defaultmodel" https://coli-saar-data.s3.eu-central-1.amazonaws.com/raw_text_model.tar.gz
6364
else
6465
echo "model not found at $model. Please check the -m parameter"
6566
fi
@@ -69,8 +70,7 @@ if [ -f "$jar" ]; then
6970
echo "jar file found at $jar"
7071
else
7172
echo "jar file not found at $jar, downloading it!"
72-
# TODO replace this with code that downloads the jar file from the internet
73-
cp /proj/irtg.shadow/tools/am-tools-all.jar "$jar"
73+
wget -O "$jar" https://coli-saar-data.s3.eu-central-1.amazonaws.com/am-tools.jar
7474
fi
7575

7676

0 commit comments

Comments
 (0)