meg HF Staff commited on
Commit
2a9dab9
·
verified ·
1 Parent(s): 6c04bde

Switching around bash logic a bit.

Browse files
Files changed (1) hide show
  1. entrypoint.sh +16 -12
entrypoint.sh CHANGED
@@ -17,26 +17,30 @@ python /parse_requests.py | while read line; do
17
  export run_dir="./runs/" #${experiment_name}/${backend_model}/${now}"
18
 
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."
 
17
  export run_dir="./runs/" #${experiment_name}/${backend_model}/${now}"
18
 
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
+ echo "Finished; uploading dataset results"
22
+ python /create_results.py ./runs
23
 
24
  done || {
25
  echo "An error occurred while benchmarking the model..."
26
  echo "Using curl to retrieve the space run log."
27
+ logs_name=./runs/logs-${now}.txt
28
+ curl https://api.hf.space/v1/${SPACE}/logs/run -H "Authorization: Bearer ${DEBUG}" > ${logs_name}
29
+ python /failed_run.py --run_dir $run_dir --model_name $backend_model --logs_name $logs_name
30
  }
31
 
32
+ #if [ -s ./runs/logs-${now}.txt ]; then
33
+ # # error.log is not-empty, an error was raised
34
+ # echo "An error was raised while benchmarking the model..."
35
+ # python /failed_run.py --run_dir $run_dir --model_name $backend_model
36
+ #
37
  # # Delete the current run directory so that it is not pushed by create_results.py later
38
  # rm -rf $run_dir
39
+ #else
40
+ # # The file is empty, so no error
41
+ # echo "Finished; uploading dataset results"
42
+ # python /create_results.py ./runs
43
+ #fi
44
 
45
  # Pausing space
46
  echo "Pausing space."