Spaces:
Runtime error
Runtime error
meg-huggingface
commited on
Commit
·
bee1453
1
Parent(s):
c60e715
Testing whether timeout for taking too long works.
Browse files- entrypoint.sh +6 -1
entrypoint.sh
CHANGED
@@ -19,9 +19,14 @@ python /parse_requests.py | while read -r line; do
|
|
19 |
mkdir -p "$run_dir"
|
20 |
|
21 |
# Let the benchmarking begin!
|
22 |
-
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" ||
|
23 |
# If the benchmark fails, update accordingly. Remove the run directory for that specific model.
|
24 |
(python /failed_run.py --run_dir "${run_dir}" --model_name "${backend_model}" && rm -rf $run_dir)
|
|
|
|
|
|
|
|
|
|
|
25 |
done
|
26 |
|
27 |
echo "Finished; uploading dataset results"
|
|
|
19 |
mkdir -p "$run_dir"
|
20 |
|
21 |
# Let the benchmarking begin!
|
22 |
+
timeout 5 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" ||
|
23 |
# If the benchmark fails, update accordingly. Remove the run directory for that specific model.
|
24 |
(python /failed_run.py --run_dir "${run_dir}" --model_name "${backend_model}" && rm -rf $run_dir)
|
25 |
+
if [ $? -eq 124 ]; then
|
26 |
+
# Timeout occurred
|
27 |
+
echo "timeout occurred"
|
28 |
+
python /failed_run.py --run_dir "${run_dir}" --model_name "${backend_model}" --reason "TAKES_TOO_LONG" && rm -rf $run_dir
|
29 |
+
fi
|
30 |
done
|
31 |
|
32 |
echo "Finished; uploading dataset results"
|