Spaces:
Runtime error
Runtime error
Unifying Regis, me, Sasha code to see if it can all come together.
Browse files- entrypoint.sh +17 -16
entrypoint.sh
CHANGED
|
@@ -19,23 +19,24 @@ python /parse_requests.py | while read line; do
|
|
| 19 |
optimum-benchmark --config-name ${experiment_name} --config-dir /optimum-benchmark/examples/energy_star/ backend.model=${backend_model} backend.processor=${backend_model} hydra.run.dir=${run_dir} 2> $run_dir/error.log
|
| 20 |
|
| 21 |
done || {
|
| 22 |
-
echo "
|
|
|
|
| 23 |
curl https://api.hf.space/v1/${SPACE}/logs/run -H "Authorization: Bearer ${DEBUG}" > ./runs/logs-${now}.txt
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
#
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
|
| 40 |
# Pausing space
|
| 41 |
echo "Pausing space."
|
|
|
|
| 19 |
optimum-benchmark --config-name ${experiment_name} --config-dir /optimum-benchmark/examples/energy_star/ backend.model=${backend_model} backend.processor=${backend_model} hydra.run.dir=${run_dir} 2> $run_dir/error.log
|
| 20 |
|
| 21 |
done || {
|
| 22 |
+
echo "An error occurred while benchmarking the model..."
|
| 23 |
+
echo "Using curl to retrieve the space run log."
|
| 24 |
curl https://api.hf.space/v1/${SPACE}/logs/run -H "Authorization: Bearer ${DEBUG}" > ./runs/logs-${now}.txt
|
| 25 |
+
python /failed_run.py --run_dir $run_dir --model_name $backend_model
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
if [ -s ./runs/logs-${now}.txt ]; then
|
| 29 |
+
# error.log is not-empty, an error was raised
|
| 30 |
+
echo "An error was raised while benchmarking the model..."
|
| 31 |
+
python /failed_run.py --run_dir $run_dir --model_name $backend_model
|
| 32 |
+
|
| 33 |
+
# # Delete the current run directory so that it is not pushed by create_results.py later
|
| 34 |
+
# rm -rf $run_dir
|
| 35 |
+
else
|
| 36 |
+
# The file is empty, so no error
|
| 37 |
+
echo "Finished; uploading dataset results"
|
| 38 |
+
python /create_results.py ./runs
|
| 39 |
+
fi
|
| 40 |
|
| 41 |
# Pausing space
|
| 42 |
echo "Pausing space."
|