meg HF Staff commited on
Commit
3226c9d
·
verified ·
1 Parent(s): bd9b4b3

Adding bash's equivalent of try...catch.

Browse files
Files changed (1) hide show
  1. entrypoint.sh +3 -2
entrypoint.sh CHANGED
@@ -17,8 +17,10 @@ python /parse_requests.py | while read line; do
17
 
18
  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
19
 
 
20
  echo "Trying the curl thing."
21
- curl https://api.hf.space/v1/${SPACE}/logs/run -H
 
22
 
23
  #if [ -s $run_dir/error.log ]; then
24
  # # error.log is not-empty, an error was raised
@@ -28,7 +30,6 @@ python /parse_requests.py | while read line; do
28
  # # Delete the current run directory so that it is not pushed by create_results.py later
29
  # rm -rf $run_dir
30
  #fi
31
- done
32
 
33
  # The file is empty, so no error
34
  echo "Finished; uploading dataset results"
 
17
 
18
  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
19
 
20
+ done || {
21
  echo "Trying the curl thing."
22
+ curl https://api.hf.space/v1/${SPACE}/logs/run
23
+ }
24
 
25
  #if [ -s $run_dir/error.log ]; then
26
  # # error.log is not-empty, an error was raised
 
30
  # # Delete the current run directory so that it is not pushed by create_results.py later
31
  # rm -rf $run_dir
32
  #fi
 
33
 
34
  # The file is empty, so no error
35
  echo "Finished; uploading dataset results"